Check value is available in Hashtable or not

Below code will check the value is available in Hashtable or not

import java.util.Hashtable;
import java.util.*;

public class HashtableValueCheck {

public static void main(String[] args) {

Hashtable hashtable = new Hashtable();

hashtable.put(“Device 1”, “iphone”);
hashtable.put(“Device 2”, “ipad”);
hashtable.put(“Device 3”, “Android”);
hashtable.put(“Device 4”, “BlackBerry”);

boolean ValueAvailable = hashtable.contains(“Android”);

if (ValueAvailable) {
System.out.println(“Value is available in Hashtable”);
} else {
System.out.println(“Value is not available in Hashtable”);
}
}
}

Output

Value is not available in Hashtable