title: Labeled loop in Java
body: <p>I having been staring at my screen for a while and I do really need an explanation for labeled loop in this scenario:</p>
  
  <pre><code>package com.misterkourouma.oca8.starter.test;
  
  public class LabeledLoop{
  
      public static void main(String[] args) {
          int x = 5, j = 0;
          OUTER: for (int i = 0; i &lt; 3;) // -&gt; This line has no curly braces but still compiles
              INNER: do {
                  i++;
                  x++;
                  if (x &gt; 10)
                      break INNER;
                  x += 4;
                  j++;
              } while (j &lt;= 2);
  
          System.out.println(x);
      }
  }
  </code></pre>
  
  <p>But this one does not compile :</p>
  
  <pre><code>package com.misterkourouma.oca8.starter.test;
  
  public class LabeledLoop2{
      public static void main(String[] args) {
          int x = 5, j = 0;
          OUTER: for (int i = 0; i &lt; 3;)
              System.out.println("Labeled Loop");
              INNER: do {
                  i++;
                  x++;
                  if (x &gt; 10)
                      break INNER;
                  x += 4;
                  j++;
              } while (j &lt;= 2);
          System.out.println(x);
      }
  }
  </code></pre>
  
  <p>All the <code>INNER:</code> block are considered (I guess) as a single statement but It does not end with semicolon I wonder Why?<br/><br/>
  I am preparing for OCA 8 that's one of the reason I need to understand these weirds stuffs.<br/><br/></p>
  
  <p><strong>EDIT:</strong><br/>
  <strong>My question is on LabeledLoop example why does it compiles</strong><br/>
  Thanks in advance for your help.</p>