Properties is a subclass of Hashtable. It uses a list of values in which key and value is a String. many other Java classes use Properties.
import java.util.Dictionary;
import java.util.Hashtable;
import java.util.Properties;
import java.util.Enumeration;
class PropertiesJavaExample
{
public static void main(String args[])
{
Properties k = new Properties();
String s,a;
k.put("Rajsthan","Jaipur");
k.put("Tamilnadu","Chennai");
k.put("MP","Bhopal");
k.put("Gujrat","Gandhinagar");
try
{
s=args[0];
}
catch(ArrayIndexOutOfBoundsException e)
{
System.out.println("The Command Line Argument Missing");
return;
}
a=k.getProperty(s);
if(a != null)
System.out.println("Capital of "+s+" is "+a);
else
System.out.println("The State Specified is not Available");
}
}