文章目录
1.Properties类
1.1包
java.util.Properties
1.2类结构
public class Properties extends Hashtable<Object,Object>
1.3配置文件
resources/user.properties
user.username = admin
user.password = 223
1.4解析
Properties prop = new Properties();
String path = Thread.currentThread().getContextClassLoader().getResource("").getPath();
String fileName = path+"com/dyit/resources/user.properties";
prop.load(new FileReader(fileName));
System.out.println("用户名: "