title: How to break from a loop after the condition is met
body: <p>Hi I have been trying for the past hour to break from this loop and continue since already met my condition once. My application pretty much reads a serie of lines and analyzes it and then prints the variable stated. An example of how the lines look like (the . are not included):</p>
  
  <ul>
  <li>10 c = 9+3 </li>
  <li>20 a = c+1 </li>
  <li>30 print c </li>
  <li>40 goto 20 </li>
  <li>50 end</li>
  </ul>
  
  <p>It does everything right, when it gets to line 40 goes to line 20 as expected, but i want it to go to line 50 since already went to line 40 once. Here is my code for this part:</p>
  
  <pre><code>while(booleanValue)
  {
      if(aString.substring(0, 4).equals("goto"))
      {
          int chosenLine = Integer.parseInt(b.substring(5));
          if(inTheVector.contains(chosenLine))
          {
              analizeCommands(inTheVector.indexOf(chosenLine));
              i++;
          }
          else
          {
              System.ou.println("Line Was Not Found");
              i++;
          }
      }
  
      else if(aString.substring(0, 3).equals("end"))
          {
              System.out.println("Application Ended");
              booleanValue = false;
          }
  }
  </code></pre>