Java tutorial
import java.io.StringWriter; import java.util.Properties; public class Main { public static void main(String[] args) throws Exception { Properties prop = new Properties(); StringWriter sw = new StringWriter(); prop.setProperty("Chapter Count", "200"); prop.put("Tutorial Count", "1500"); prop.put("tutorial", "java2s.com"); // print the list System.out.println(prop); // store the properties list in an output writer prop.store(sw, "Main"); System.out.println(sw.toString()); } }