title: Java - Does returning a value break a loop?
body: <p>I'm writing some code that basically follows the following format:</p>
  
  <pre><code>public static boolean isIncluded(E element) {
      Node&lt;E&gt; c = head;
      while (c != null) {
          if (cursor.getElement().equals(element)) {
              return true;
          }
          c = c.getNext();
      }
      return false;
  }
  </code></pre>
  
  <p>The code will search for an element in a list of nodes. However, my question is that if the while loop does find the element where the if-statement says it should return true, will it simply return true and break the loop? Furthermore, if it does then break the loop will it then carry on through the method and still return false, or is the method completed once a value is returned?</p>
  
  <p>Thanks</p>