1.配置文件的创建
2.配置文件的创建
public static void main(String[] args) {
// TODO 自动生成的方法存根
String path = System.getProperty("user.dir"); //获取项目路径
String filePath=path+"/src/s.properties"; //拼串
InputStream is = null;
Properties prop=new Properties();
try {
is = new FileInputStream(filePath);
prop.load(is);
} catch (FileNotFoundException e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
} catch (IOException e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}
System.out.println(prop.getProperty("a"));
}