本帖最后由 bowen-xiao 于 2015-1-20 10:26 编辑
- /**
- * Properties类演示
- * key,value都String类型对象
- * @since JDK 1.6
- */
- public void propertiesTest(){
- Properties pro = new Properties();
- pro.setProperty("zhangsanfeng", "55");
- pro.setProperty("wangwang", "45");
- pro.setProperty("linning", "67");
-
- Set<String> names = pro.stringPropertyNames();
- for (String s : names) {
- System.out.println(s+"="+pro.getProperty(s));
- }
- }
复制代码 |
|