import java.io.IOException;
import java.util.Properties;
public class PropReader {
private static Properties props = null;
static {
try {
props = new Properties();
props.load(PropReader.class.getClassLoader().getResourceAsStream(
"sysParams.properties"));
System.out.println(props.toString());
} catch (IOException e) {
e.printStackTrace();
}
}
public String getProperty(String key) {
return props.getProperty(key);
}
}
java读取properties文件
最新推荐文章于 2024-11-26 09:07:46 发布