/*
The properties class uses system's Getproerties to return systems properties to pass a System.out
The use of this class is to read an INI configuration file information key = value
See Docs in concrete usage
*/
Import java.util.*;
Import java.io.*; FileInputStream in this bag.
Class Proptest
{
public static void Main (String []args)
{
/*properties p=system.getproperties ();
P.list (System.out); Output Java Run-time Systems Information System Property JVM
*/
Properties P=new properties (); New A Properties Object
Try
{
P.load (New FileInputStream ("Info.ini"));/load a file input stream
}
catch (Exception e)
{
E.printstacktrace ();
}
Enumeration Em=p.propertynames (); 1.0-1.1java the new set frame before it came out of the enumeration
while (Em.hasmoreelements ())//If more elements exist
{
String key= (String) em.nextelement ();//Return Object object we want to convert to string
String Value=p.getproperty (key); Get Value by key
System.out.println ("key=" +key+ "------" + "value=" +value);
}
}
}