Problem:
Let me put it as sim as I can. I have an if statement in my code and it returns a value. Since IF is a boolean statement it should return value whether it’s true or false. So, in my program when a method tests an argument and returns a true or false value, it should return. That all I am trying to say. I already wrote a code attaching below:
public boolean isValid() {
boolean examine;
int var = 10;
if (var > 5){
examine = true;
} else {
examine = false;
}
return examine;
Now, I want to use my isValid() method as a parameter in a different method inside an IF statement. How should I do that?
Any kind of help is appreciated by my side.
Thanks.