??????????Java??д????????
????????
Properties props = System.getProperties();
Enumeration prop_names = props.propertyNames();
while (prop_names.hasMoreElements()) {
String prop_name = (String) prop_names.nextElement();
String property = props.getProperty(prop_name);
System.out.println(“Property ‘” + prop_name + “‘ is ‘”+ property + “‘”);
}
????д??
????System.setProperties(props);
????????properties????????????÷?
??????????????properties????????????key??value?????????”a=2″
?????÷???
public class Test {
public static void main(String args[]) {
try {
String name = “test.properties”;
InputStream in = new BufferedInputStream(new FileInputStream(name));
Properties p = new Properties();
p.load(in);
System.out.println(“a???==” + p.getProperty(“a”));
} catch (Exception err) {
err.printStackTrace();
}
}
}