Click here to watch in Youtube : https://www.youtube.com/watch?v=pGX9MS1SB8A&list=UUhwKlOVR041tngjerWxVccwHashtableExample.java import java.util.Hashtable;
/*
* Example of size() method.
*/
public class HashtableExample
{
public static void main( String[] args )
{
Hashtable<String, String> hashtable = new Hashtable<String, String>();
/*
* Key = CountryCode,Value = CountryName
*/
hashtable.put("AF", "AFGHANISTAN");
hashtable.put("BE", "BELGIUM");
hashtable.put("US", "UNITED STATES");
hashtable.put("IN", "INDIA");
System.out.println("hashtable : " + hashtable + "\n");
/*
* Returns the number of keys in this hashtable.
*/
int size = hashtable.size();
System.out.println("size : " + size);
}
}