?? configuration.java
字號:
package test;
import java.util.Properties;
import java.io.InputStream;
import java.io.IOException;
public class Configuration {
private Properties properties;
private final static Configuration cfg = new Configuration();//單子模型
private Configuration() {
properties = new Properties();
InputStream is = null;
try {
is = getClass().getResourceAsStream("/ApplicationResources.properties");
properties.load(is);
} catch (Exception exception) {
System.out.println("Can't read the properties file. ");
} finally {
try {
if (is != null)
is.close();
} catch (IOException exception) {
// ignored
}
}
}
public static Configuration getInstance() {
return cfg;
}
public String getValue(String key) {
return properties.getProperty(key);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -