title: Java - multiple return statements - first one not returning?
body: <p>I'm toying around with some Android programming, and was in the process of writing a couple methods to open and close a file.  Well, I wanted to do some basic checks on the file and return true if the conditions were satisfied, or return false if it reaches the end of the method.</p>
  
  <p>I was testing these with AndroidTestCase, and after I added a required permission to my manifest to fix my "canRead()" call, I started stepping through them.  I see the debugger hit my "return true" statement, but then stepping over that, it moves on to the following line "return false" instead of actually returning.</p>
  
  <p>I know I could wrap the "return false" in an else block, but am just curious why the function continues to execute after supposedly returning.  Is a return statement inside an "if" block just returning out of the block, or should it be returning out of the whole function call?</p>
  
  <pre><code>public boolean OpenFile(String testFile) {
      myFile = new File(testFile);
      if (myFile.exists() &amp;&amp; myFile.isFile() &amp;&amp; myFile.canRead()) {
          return true;
      }
      return false;
  }
  
  public boolean CloseFile() {
      if (myFile != null ) {
          return true;
      }
      return false;
  }
  </code></pre>