相关代码 |
|
package apibook.c2.s1; import java.util.*; import java.io.*; public class TestProperties { public TestProperties() { } public static void main(String[] args) { //创建一个属性列表 Properties p1 = new Properties(); //设置属性列表中的属性-值对 p1.setProperty("k1","api books"); //显示属性列表中的所有属性-值对 System.out.println(p1); try { p1.store(new FileOutputStream("out.features"),"good face"); } catch (Exception ex) { ex.printStackTrace(); } } }