Properties类
此类就是为了读取*.properties文件而设计的API,其底层就是文本文件IO
,Properties本身实现Map接口,内部是散列表,限定了key和value都是String类型,
其内的方法
load(流):将文件读取为散列表
String getProperty(key) 查询value
使用步骤
1.创建Properties对象
2.利用load()方法读取文件:类名.class
.getClassLoader()
.getResourceAsStream("文件名(例如*.properties)");
3.查找文件内容
利用Properties对象.getProperties()方法