Java.util.Properties.getProperty(String key,String defaultValue) 方法 Java.util.Properties.getProperty(String key) 方法 Java.util.Properties.list(PrintStream out) 方法 Java.util.Properties.getProperty(String key,String defaultValue) 方法 package com.codingdict; import java.util.*; public class PropertiesDemo { public static void main(String[] args) { Properties prop = new Properties(); // add some properties prop.put("Height", "200"); prop.put("Width", "150"); prop.put("Scannable", "true"); // get two properties and print them System.out.println("" + prop.getProperty("Scannable","false")); System.out.println("" + prop.getProperty("Width","150")); } } Java.util.Properties.getProperty(String key) 方法 Java.util.Properties.list(PrintStream out) 方法