IO + Properties

经常改变的数据,可以单独写到一个文件中,使用程序动态读取 属性配置文件中#为注释
文件 username=123
password=123456
调用Properties对象的load方法将文件中的数据加载到Map集合中
FileReader reader = new FileReader("name");
Properties p = new Properties();
p.load(reader) 文件中的数据顺着管道加载到Map集合中,其中等号=左边做key,右边做value

posted @ 2020-08-09 18:38  javase-->  阅读(87)  评论(0)    收藏  举报