, RAM .., ( ), - , , .
, , : .
, .
, , , . : . - ( , ), , , .
, , , .. :
private static final String CONSTANT_FOO;
private static final String CONSTANT_BAR;
static{
try{
Properties props = new Properties();
InputStream is =
MyConstantClass.class
.getResourceAsStream("my.module.properties");
props.load(is);
is.close();
CONSTANT_FOO = props.get("constants.foo");
CONSTANT_BAR = props.get("constants.bar");
}catch(Exception e){
throw new IllegalStateException(e);
}
}
, , .