Friday, April 20, 2012

When to use "getResourceAsStream" method?

I was confused using the said method because while loading some properties file people are following a different approaches...



Properties prop 
= new Properties(new FileInputStream(new File("<path of the properties file>"));


and few are using..



Properties prop 
= new Properties(getClass().getResourceAsStream("<path of the properties file>"));


Which one to use when?





No comments:

Post a Comment