配置文件
java.util.Properties属性类,针对属性文件操作,早期使用。好处是可以在不修改代码的情况下改变相应的需求。(课堂代码:TestProperty.java)
文件名以.properties结尾的文件称为属性文件
文件的内容是:名字=值 的形式
常用方法:
public void load(InputStream inStream)throws IOException
public String getProperty(String key)
public String getProperty(String key,String defaultValue)
public void store(OutputStream out,String comments)throws IOException
public Object setProperty(String key,String value)
public void load(InputStream inStream) throws IOException
本文介绍Java中Properties类的使用方法,包括加载属性文件、获取属性值等操作。Properties类允许在不修改代码的情况下更改应用程序设置。
165

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



