title: java - Cannot convert Integer to int
body: <p>I am stuck at this problem for ages. Basically I cannot convert Integer to int.  </p>
  
  <pre><code>class CheckOdd implements Check&lt;Integer&gt;
  {
    public &lt;Integer&gt; boolean check(Integer num)
    {
      int i = (Integer) num;
      return (i % 2 != 0);
    }
  }
  </code></pre>
  
  <p>I have tried using<br>
  <code>int i = (Integer) object;</code>   <code>int i = (int) object;</code>  <code>intValue()</code><br>
  but still no luck. If I use <code>int i = (Integer) object;</code> it produce <code>error:incompatible types</code>.
  If I use <code>int i = (int) object;</code> it produce <code>error: inconvertible types</code>.  </p>
  
  <p>Please Help. Thank you in advance. </p>