package
intensiveexercise;
import
java.io.FileInputStream;
import
java.io.IOException;
import
java.util.Properties;
///http://www.cnblogs.com/bakari/p/3562244.html
public
class Q18Properties {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
Properties prop = new Properties ();
FileInputStream fis = new FileInputStream ("Q:/Users/a496006.DMN1.000/Desktop/q13/Message.properties");
prop.load(fis);
System.out.println(prop.getProperty("welcome1")); //
System.out.println(prop.getProperty("welcome2", "Test"));//Default Test
System.out.println(prop.getProperty("welcome3")); //Null
}
}
时间: 2024-10-29 19:16:58