title: Why does Java not show an error for double semicolon at the end of a statement?
body: <p>I accidentally wrote a java statement with two semicolons at the end.  The java compiler does not show any error and it runs. </p>
  
  <p>Code:</p>
  
  <pre><code>System.out.println("Length after delete the text is "+name.length());;
  </code></pre>
  
  <p>For learning purposes I tried adding different characters after the semicolon, and the java compiler has shown the compile time error as <strong>Syntax error on token ")", delete this token</strong>.</p>
  
  <p>This statement:</p>
  
  <pre><code>System.out.println("Length after delete the text is "+name.length());)
  </code></pre>
  
  <p>Why does java treat the semicolon and other characters as different?</p>