BACK
This function returns a set view of the keys contained in the map.
Example Program
import java.util.HashMap; public class Containsvalue { public static void main(String args[]) { HashMap hp=new HashMap(); hp.put("1", "java"); hp.put("2", "c++"); hp.put("3","dbms"); hp.put("4", "oops"); System.out.println("Returns:"+hp.containsValue("c++")); System.out.println("Returns:"+hp.containsValue("oops")); } }
Output
Returns:true
Returns:true