11:03 pm - Saturday May 27, 2017

Hashtable Example program for clear()

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044
/**
Author :candidjava.com
Description: Clears this hashtable so that it contains no keys.
*/
import java.util.*;
import java.util.Hashtable;
import java.io.IOException;
public class HashtableClearExample
{
public static void main(String args[])throws IOException
{
Hashtable h=new Hashtable();
h.put(1,11);
h.clear();            //it clears both the key and values which stores in hash table
System.out.println(h);
}
}


Output:
{ }

Filed in: Core Java Tutorial

Comments are closed.