Check if a particular value exists in LinkedHashMap - Java Collection Framework

Java examples for Collection Framework:LinkedHashMap

Description

Check if a particular value exists in LinkedHashMap

Demo Code


import java.util.LinkedHashMap;
 
public class Main {
 
  public static void main(String[] args) {
    LinkedHashMap lHashMap = new LinkedHashMap();
   // w w  w  .j a v  a2s .  com
    lHashMap.put("1","One");
    lHashMap.put("2","Two");
    lHashMap.put("3","Three");
   
    boolean blnExists = lHashMap.containsValue("Two");
    System.out.println("Two exists in LinkedHashMap ? : " + blnExists);
  }
}

Result


Related Tutorials