Java.util.Properties.getProperty(String key) 方法


Java.util.Properties.getProperty(String key) 方法

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"));
      System.out.println("" + prop.getProperty("Width"));
   }
}