
Implement a public java method which takes two parameters of type 'int'. If the values of the parameters are equal, it should return boolean true. Else it should return boolean false.
Use minimum number of variables and statements.

class JavaMethod
{
public boolean check(int n1,int n2){
if(n1==n2){
return true;
}
else{
return false;
}
}
public static void main(String[] args)
{
int num1=7;
int num2=9;
JavaMethod m=new JavaMethod();
boolean value=m.check(num1,num2);
System.out.println(value);
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.