zoukankan      html  css  js  c++  java
  • IO流,Properties 的Load()和Stroe()功能。

    public class Properties {
    public static void main(String[] args) throws FileNotFoundException, IOException {
    test1();
    test2();
    java.util.Properties prop = new java.util.Properties();
    prop.load(new FileInputStream("/demo/src/demo/user.properties"));//加载数文件内容
    prop.setProperty("user9", "654555jfgjdjss>8888");//对文件内容进行修改
    prop.store(new FileOutputStream("/demo/src/demo/user.properties"), "对文件列表的描述,如果不描述就写NULL");//将修改后的写到硬盘里
    System.out.println(prop);


    }

  • 相关阅读:
    Codeforces 937D
    Codeforces 458C
    Codeforces 934D
    Codeforces 934C
    Codeforces 36B
    Codeforces 374C
    Codeforces 374D
    编译优化
    Codeforces E
    Codeforces 920G
  • 原文地址:https://www.cnblogs.com/wangffeng293/p/13263746.html
Copyright © 2011-2022 走看看