【发布时间】:2012-04-20 13:25:30
【问题描述】:
我对使用上述方法感到困惑,因为在加载某些属性文件时,人们采用了不同的方法......
Properties prop
= new Properties(new FileInputStream(new File("<path of the properties file>"));
很少有人使用..
Properties prop
= new Properties(getClass().getResourceAsStream("<path of the properties file>"));
什么时候用?
【问题讨论】:
-
小细节 - 又少了 1 个右括号
标签: java properties