Java examples for Collection Framework:Hashtable
Remove all values from Hashtable
import java.util.Hashtable; public class Main { public static void main(String[] args) { Hashtable ht = new Hashtable(); //from ww w . ja va 2 s . c o m ht.put("1","One"); ht.put("2","Two"); ht.put("3","Three"); ht.clear(); System.out.println("Total key value pairs in Hashtable are : " + ht.size()); } }