import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;
public class PropertiesDemo03 {
public static void main(String[] args) {
Properties pro = new Properties();
File file = new File("E:" + File.separator + "Area.properties");
try {
pro.load(new FileInputStream(file));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("BJ:" + pro.getProperty("BJ"));
}
}
时间: 2024-10-06 03:44:29