How to check if specific value exists in LinkedHashMap in Java

1 Answer

0 votes
package javaapplication1;

import java.util.LinkedHashMap;

public class JavaApplication1 {

    public static void main(String[] args) {

        LinkedHashMap lHashMap = new LinkedHashMap();
   
        // key value pairs
        lHashMap.put("1", "Java");
        lHashMap.put("2", "C#");
        lHashMap.put("3", "C++");
        lHashMap.put("4", "C");
        lHashMap.put("5", "PHP");

        boolean b = lHashMap.containsValue("C++");
        System.out.println(b);
  }
}
  
/*
run:

true

*/

 



answered Sep 27, 2016 by avibootz

Related questions

1 answer 204 views
1 answer 149 views
2 answers 133 views
1 answer 199 views
1 answer 191 views
1 answer 155 views
1 answer 227 views
...