创建和初始化Properties对象的方法

在Java中,可以通过直接实例化Properties类来创建对象,例如:Properties props = new Properties(); 这样就得到了一个空的Properties对象,接下来可以通过put或setProperty方法添加键值对。