Properties
笔试题:
修改Properties文件中key=name的值修改为张三:
name=李四
ip=192.168.1.1
age=33
void load(InputStream inStream)
Reads a property list (key and element pairs) from the input byte stream.
Object setProperty(String key, String value)
Calls the Hashtable method put.
void store(OutputStream out, String comments)
Writes this property list (key and element pairs) in this Properties table to the output stream in a format suitable for loading into a Properties table using the load(InputStream) method.
笔试题:
修改Properties文件中key=name的值修改为张三:
name=李四
ip=192.168.1.1
age=33
void load(InputStream inStream)
Reads a property list (key and element pairs) from the input byte stream.
Object setProperty(String key, String value)
Calls the Hashtable method put.
void store(OutputStream out, String comments)
Writes this property list (key and element pairs) in this Properties table to the output stream in a format suitable for loading into a Properties table using the load(InputStream) method.
本文介绍了如何使用Java的Properties类来读取和修改配置文件。具体包括加载Properties文件、修改键值对以及将更新后的属性保存回文件的方法。
178

被折叠的 条评论
为什么被折叠?



