title: Break in nested for loops
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/13073300/how-to-break-from-main-outer-loop-in-a-double-nested-loop">How to Break from main/outer loop in a double/nested loop?</a>  </p>
  </blockquote>
  
  
  
  <p>I have the following situation:</p>
  
  <pre><code>      for(int i = 0; i &lt; schiffe.length-1; i++){
              if(schiffe[i].schaden){
                  schlepper.fliege(schiffe[i].x, 
                                   schiffe[i].y, 
                                   schiffe[i].z);
                  schlepper.wirdAbgeschleppt = schiffe[i];
                  for(int k = 0; k &lt; stationen.length-1; k++){
                      if(stationen[k].reparatur == null){
                          schlepper.fliege(stationen[k].x,
                                           stationen[k].y,
                                           stationen[k].z);
                          break;
                      }
                  }
              }
          }
  </code></pre>
  
  <p>I want to </p>
  
  <pre><code>schlepper.fliege(stationen[k].x,
                   stationen[k].y,
                   stationen[k].z);
  </code></pre>
  
  <p>be performed once and then break out of the inner loop and continue with the for(int i... loop. So I used a break in my code. But I am not really sure if this is right. Does the break cause a break for all loops or just for the second loop?</p>