Java中的Properties

Properties在Java中的结构:

Properties继承的Hashtable早已弃用,但是Properties继承Map接口,Map接口实现的方法它都可以使用。

Properties的特有方法:



Properties与IO流结合的方法:


以字符流为例:字节流的话如果内容有中文则在aniki.txt中会有乱码。
把集合中的键值对写出到文件中(字符流)然后再从文件中写到程序里
String comments是properties文件的头注释


原文地址:https://www.cnblogs.com/maomaodesu/p/11913495.html