package com.bjpowernode.demo01;
import java.util.Properties;
/**
* Properties
* 是HashTable的子类, 特点是,它的键与值都是String字符串
* 常用来设置/读取属性值
* setProperty(属性名, 属性值)
* getProperty(属性名)
*
* @author Administrator
*
*/
public class Test07 {
public static void main(String[] args) {
Properties properties = new Properties();
//设置属性值
properties.setProperty("usernmae", "bjpowernode");
properties.setProperty("password", "1234");
System.out.println( properties.getProperty("usernmae"));
System.out.println( properties.getProperty("password"));
}
}
java基础回顾之Map中Hashtable子类 Properties
最新推荐文章于 2022-12-19 00:01:26 发布