Java.util.Properties.setProperty(String key,String value) 方法


Java.util.Properties.setProperty(String key,String value) 方法

package com.codingdict;

import java.util.*;

public class PropertiesDemo {
   public static void main(String[] args) {
      Properties prop = new Properties();

      // add some properties
      prop.setProperty("Height", "200");
      prop.put("Width", "1500");

      // print the list
      System.out.println("" + prop);

      // change the properties
      prop.setProperty("Width", "15");
      prop.setProperty("Height", "500");

      // print the list
      System.out.println("" + prop);
   }
}