title: How do I return boolean in Java?
body: <pre><code>public boolean isOdd (int value) {
      if ((value % 2)== 0){ 
          return false; 
      } else if ((value % 2) &gt; 0){ 
          return true; 
      }
  } 
  </code></pre>
  
  <p>I get an error saying:
  private boolean isOdd(int value) throws Exception{
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  This method must return a result of type boolean</p>
  
  <p>I tried doing:</p>
  
  <pre><code>public boolean isOdd (int value) {
      boolean isOdd =  ((value % 2) &gt; 0);
      return true; 
  } 
  
  public boolean isEven (int value) {
      boolean isEven = ((value % 2) &gt; 0);
      return true;
  } 
  </code></pre>
  
  <p>and it only returns true as an output.</p>
  
  <p>I have no clue what I'm doing wrong here!</p>