📄 propertyfilecreator.java
字号:
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();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -