Usefull sample codes for Java. Containt all type of programs.

源代码在线查看: propertyfilecreator.java

软件大小: 347 K
上传用户: happy_christina
关键词: Containt programs Usefull sample
下载地址: 免注册下载 普通下载 VIP

相关代码

				import java.io.*;
				import java.util.*;
				
				public class PropertyFileCreator {
				    public PropertyFileCreator() {
				        Properties prop = new Properties();
				        prop.setProperty("username", "rcade");
				        prop.setProperty("browser", "Mozilla Firefox");
				        prop.setProperty("showEmail", "no");
				        try {
				            File propFile = new File("properties.xml");
				            FileOutputStream propStream = new FileOutputStream(propFile);
				            Date now = new Date();
				            prop.storeToXML(propStream, "Created on " + now);
				        } catch (IOException exception) {
				            System.out.println("Error: " + exception.getMessage());
				        }
				    }
				    
				    public static void main(String[] arguments) {
				        PropertyFileCreator pfc = new PropertyFileCreator();
				    }
				}			

相关资源