properties 特有的方法
生活随笔
收集整理的這篇文章主要介紹了
properties 特有的方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
/*** properties 特有的方法*/
public class Demo2 {public static void main(String[] args) {Properties prop = new Properties();//添加prop.setProperty("a", "寶馬");prop.setProperty("b", "奔馳");prop.setProperty("c", "奧迪");System.out.println(prop);//根據鍵查值String property = prop.getProperty("b");System.out.println(property);//遍歷 獲得所有鍵的 set集合Set<String> strings = prop.stringPropertyNames();for (String key : strings) {String value = prop.getProperty(key);System.out.println(key + " " + value);}}
}
總結
以上是生活随笔為你收集整理的properties 特有的方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 车主信用卡加油优惠 看看哪家银行最给力
- 下一篇: 钟薛高为何室温下放置1小时不化引网友担心