title: How to terminate a while loop from a loop inside
body: <p>I'm new to Java, and I want to know if it is possible to break a while loop from an if/for loop inside, for example:</p>
  
  <pre><code>while(true)
  {
      for(i=0;i&lt;=10;i++)
      {
          if(i==9) break;
      }
  }
  </code></pre>
  
  <p>This will terminate the for loop(I think?), but how do I terminate the while loop when i reaches 9?</p>