版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yulidrff/article/details/85335100
public class PropertiesUtil {
private static Properties properties = new Properties();
static {
InputStream in = PropertiesUtil.class.getResourceAsStream("/config.properties");
try {
properties.load(in);
} catch (IOException e) {
e.printStackTrace();
}
}
public static String get(String key) {
return properties.getProperty(key).trim();
}
}