package devmanuals.com; import java.util.Map; import java.util.HashMap; import java.util.Collection; public class MapContainsValue { public static void main (String args[]){ Map mp=new HashMap(); mp.put(1, "A"); mp.put(2, "B"); mp.put(3, "C"); mp.put(4, "D"); System.out.println("Mapping = "+mp); Collection c= mp.values(); System.out.println("collection of values = "+c); boolean bol= mp.containsValue("D"); System.out.println("Does the value D exist into the collection of values : "+bol); bol= mp.containsValue("E"); System.out.println("Does the value E exist into the collection of values : "+bol); } }