// File: TestProperties3.java // // Author: Rahul Simha // Created: Sept 23, 1998 // // Illustrates using the an Enumeration from // a Properties object import java.util.*; import java.io.*; public class TestProperties3 { public static void main (String[] argv) { Properties p = new Properties(); // Read properties from the file "geodata". try { FileInputStream f = new FileInputStream ("geodata"); p.load (f); } catch (IOException e) { System.out.println ("Cannot open file"); System.exit(0); } // The entire list of property NAMES can be enumerated. System.out.println ("Property Names: "); Enumeration e = p.propertyNames(); while (e.hasMoreElements()) { System.out.println (e.nextElement()); } } // "main" }