本帖最后由 杨兴庭 于 2013-7-31 20:16 编辑
- import java.io.*;
- import java.util.*;
- class PropertiesDemo
- {
- public static void main(String[] args)
- {
- setAndGet();
- }
- public static void setAndGet()
- {
- Properties prop = new Properties();
- prop.setProperty("zhangsan","30");
- prop.setProperty("lisi","39");
- prop.setProperty("lisi",89+"");
- //prop.setProperty("lisi","89");
- System.out.println(value);
- Set<String> names = prop.stringPropertyNames();
- for (String s : names )
- {
- System.out.println(s+".."+prop.getProperty(s));
- }
- }
- }
复制代码 |