title: Why does a Java class compile differently with a blank line?
body: <p>I have the following Java class</p>
  
  <pre><code>public class HelloWorld {
    public static void main(String []args) {
    }
  }
  </code></pre>
  
  <p>When I compile this file and run a sha256 on the resulting class file I get </p>
  
  <pre class="lang-none prettyprint-override"><code>9c8d09e27ea78319ddb85fcf4f8085aa7762b0ab36dc5ba5fd000dccb63960ff  HelloWorld.class
  </code></pre>
  
  <p>Next I modified the class and added a blank line like this: </p>
  
  <pre><code>public class HelloWorld {
  
    public static void main(String []args) {
    }
  }
  </code></pre>
  
  <p>Again I ran a sha256 on the output expecting to get the same result but instead I got </p>
  
  <pre class="lang-none prettyprint-override"><code>11f7ad3ad03eb9e0bb7bfa3b97bbe0f17d31194d8d92cc683cfbd7852e2d189f  HelloWorld.class
  </code></pre>
  
  <p>I have read on <a href="https://www.tutorialspoint.com/java/java_basic_syntax.htm" rel="noreferrer">this TutorialsPoint article</a> that:</p>
  
  <blockquote>
    <p>A line containing only white space, possibly with a comment, is known as a blank line, and Java totally ignores it.</p>
  </blockquote>
  
  <p>So my question is, since Java ignores blank lines why is the compiled bytecode different for both programs?</p>
  
  <p>Namely the difference in that in <code>HelloWorld.class</code> a <code>0x03</code> byte is replaced by a <code>0x04</code> byte.</p>