title: The operator > is undefined for the argument type(s) Object, int
body: <p>I am writing a code to find first duplicate character in a string with following code </p>
  
  <pre><code>package collectionsExample;
  
  import java.util.*;
  
  class LinkedHashMap1
  {
      public static void main(String args[]) {
          String word = "Hare Krishna";
          char[] characters = word.toCharArray();
  
          // build HashMap with character and number of times they appear in String
          LinkedHashMap&lt;Character, Integer&gt; charMap = new LinkedHashMap&lt;Character, Integer&gt;();
          for (Character ch : characters) {
              if (charMap.containsKey(ch)) {
                  charMap.put(ch, charMap.get(ch) + 1);
              } else {
                  charMap.put(ch, 1);
              }
          }
  
          System.out.println(charMap);
          for(Map.Entry p : charMap.entrySet()){
              if(p.getValue() &gt; 1){
                  System.out.println(p.getKey());
              }
          }
      }
  }
  </code></pre>
  
  <p>But I am getting error when I do p.getValue() > 1.
  The error is The operator > is undefined for the argument type(s) Object, int
  If p.getValue() returns int then greater than and less operator should work  </p>