title: How do I check if a method returns true or false in an IF statement in Java?
body: <p>Let's say I have a boolean method that uses an <em>if</em> statement to check whether the return type should be <em>true</em> or <em>false</em>:</p>
  
  <pre><code>public boolean isValid() {
     boolean check;
     int number = 5;
  
     if (number &gt; 4){
        check = true;
     } else {
        check = false;
     }
  
   return check;
  </code></pre>
  
  <p>And now, I want to use this method as a parameter of an <em>if</em> statement in a <strong>different</strong> method: </p>
  
  <pre><code>if(isValid == true)  // &lt;-- this is where I'm not sure
     //stop and go back to the beginning of the program
  else
     //continue on with the program
  </code></pre>
  
  <p>So basically what I'm asking is, how do I check what the return type of the boolean method within the parameters of an if statement is? Your answers are deeply appreciated.</p>