class FilesDemo2{
public static void main(String[] args){

try(FileOutputStream fos = new FileOutputStream("D:\\test.properties");
FileInputStream fis = new FileInputStream("D:\\test.properties")
){
Properties p = new Properties();
p.setProperty("username", " XXX");
p.setProperty("password ","123456");
p.setProperty("sex"," X");
p.setProperty("brithday"," 2000.5.18");
p.store(fos,"");
Properties p1 = new Properties();
p1.load(fis);
System.out.println(p1);

}catch(IOException e ){
e.printStackTrace();
}
}
}

相关文章:

  • 2021-09-26
猜你喜欢
  • 2022-12-23
  • 2022-02-21
  • 2021-11-04
  • 2021-07-16
  • 2022-02-09
  • 2022-12-23
  • 2021-08-22
相关资源
相似解决方案