java - Cannot convert Integer to int
java
Solution
You've replaced `java.lang.Integer` with a generic type which you have named `Integer`
public <Integer> boolean check(Integer num) // <-- not a java.lang.Integer
should be
public boolean check(Integer num)
Problem
I am stuck at this problem for ages. Basically I cannot convert Integer to int. ``` class CheckOdd implements Check<Integer> { public <Integer> boolean check(Integer num) { int i = (Integer) num; return (i % 2 != 0); } } ``` I have tried using `int i = (Integer) object;` `int i = (int) object;` `intValue()` but still no luck. If I use `int i = (Integer) object;` it produce `error:incompatible types`. If I use `int i = (int) object;` it produce `error: inconvertible types`. Please Help. Thank you in advance.