Java examples for Collection Framework:Hashtable
Check if a particular value exists in Hashtable
import java.util.Hashtable; public class Main { public static void main(String[] args) { Hashtable ht = new Hashtable(); ht.put("1","One"); ht.put("2","Two"); ht.put("3","Three"); // ww w. jav a2 s. co m boolean blnExists = ht.contains("Two"); System.out.println("Two exists in Hashtable ? : " + blnExists); } }