title: How can i convert an object to an int in Java?
body: <p>I'm working in Java and I would like to convert an <code>Object</code> to an <code>int</code>.</p>
  
  <p>I do:</p>
  
  <pre><code>   Collection c = MyHashMap.values(); 
     Object f = Collections.max(c);
     int NumOfMaxValues = Integer.parseInt(f);
  </code></pre>
  
  <p>But it's not working. It says:
  <code>No suitable method for parseInt.</code></p>
  
  <p>How can I fix that?</p>