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.