title: Java Boolean return statement
body: <p>I'm trying to write a program that will print out a failure message if the file index doesn't exist. When I put this code into BlueJ it tells me I need a return statement. help?</p>
  
  <pre><code>public boolean validIndex(int index)
      {
          if ((index &gt;= 0) &amp;&amp; (index &lt;= files.size() - 1)) {
              return true;
          }
          else {
              System.out.println("File not found.");
          }
      }
  </code></pre>