How do i write a statement that checks the return value of a method in java. I have to do a conditional action based on the return value of true or false. How do i put this in an If statement and a while loop.
Yes. The expresions in while and for statements need to evaluate to a boolean reasult. If they don't the compiler will give out an error. If a method returns a boolean value then it indeed evaluates into a boolean result.