📄 config.java
字号:
package cn.edu.hunnu.factory;
import java.util.Properties;
import java.io.*;
public class Config{
private static Properties p;//store the relationship of product and factory
public static void init(){
try{
File f=new File("config.properties");//construct a file from config.properties
FileInputStream fs=new FileInputStream(f);
p=new Properties();
p.load(fs);//load the relationship of product and factory from f
fs.close();
}catch(Exception e){
System.out.println(e.getMessage());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -