Java.util.Properties.propertyNames() 方法


Java.util.Properties.propertyNames() 方法

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", "15");

      // assign the property names in a enumaration
      Enumeration<?> enumeration = prop.propertyNames();

      // print the enumaration elements
      System.out.println("" + enumeration.nextElement());
      System.out.println("" + enumeration.nextElement());
   }
}