Properties类的应用
生活随笔
收集整理的這篇文章主要介紹了
Properties类的应用
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
public class ListTest {@Testpublic void test3() throws IOException{Properties properties = new Properties();// 這個方法會自動處理文件, 把文件中的內容全部加載到map集合中properties.load(new FileInputStream("test.properties"));// 等價于 get()String property = properties.getProperty("email");System.out.println(property);String property2 = properties.getProperty("username");System.out.println(property2);String property3 = properties.getProperty("password");System.out.println(property3);properties.setProperty("mobile", "15353353535");System.out.println("-------------------");System.out.println(properties);}
總結
以上是生活随笔為你收集整理的Properties类的应用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【JEECG技术文档】Redis与Eac
- 下一篇: MiniDao_1.6-SNAPSHOT