Hi,
I'm beginner in Java and traying to campare 2 types: int and Integer. There is a code:
class validateIntAndInteger
{
public boolean validateIntAndInteger (int number1, Integer number2) {
if(number1 == number2) {
System.out.println("Numbers are equals.");
} else {
System.out.println("Numbers are not equals.");
}
}
}
class Application
{
public static void main (String[] args) throws java.lang.Exception
{
int number1 = 2;
Integer number2 = 4;
validateIntAndInteger personCheck = new validateIntAndInteger();{
personCheck.validateIntAndInteger( number1, number2 );
}
}
}
But there is a error: missing return statement, line 9
I don't know why?
Anyone can help?
Thank You