-1
可以說我有一個文件名config.yml,我使用properties對象來獲取屬性。我想通過記事本++和普通記事本來編輯文件,它會保留文件已經存在的內容。程序運行時文件自動更新
Properties prop = new Properties();
prop.setProperty("test", "20");
prop.store(file, null);
System.out.println(prop.getProperty("test");
輸出是20,但我希望它改變到任何文件說它是。如何在像記事本++這樣的程序中編輯文件,並獲得像30這樣的不同輸出作爲示例?
目前還不清楚你在問什麼,你能否澄清你的問題?另外,[YAML](http://yaml.org/)文件與Java屬性文件完全不同。 –
[如何重新加載java中的屬性文件]可能的重複(https://stackoverflow.com/questions/9924502/how-to-reload-properties-file-in-java) – kryger