IO流,Properties的特殊功能使用。

public class Properties {
public static void main(String[] args) {
test1();
java.util.Properties prop = new java.util.Properties();
prop.setProperty("neam","张三");
prop.setProperty("电话","13333333333");
Enumeration<String> en = (Enumeration<String>) prop.propertyNames(); //返回所有键的枚举类型
while(en.hasMoreElements()) {
String key = en.nextElement(); //获取Properties中的每一个键
String value = prop.getProperty(key);
System.out.println(key+"="+value);
}


}

posted @ 2020-07-07 22:19  一块  阅读(131)  评论(0编辑  收藏  举报