how to check whether a map has value 2 code example Example: find a value in hashmap if(hashMap.containsKey(key)) { Object o = hashMap.get(key); }