title: Trying to understand the print order of b.h and b.getH() in this code
body: <p>I want to know why the following code prints:</p>
  
  <pre><code>Beta 44
  44 44
  </code></pre>
  
  <p>Please correct me because my analysis is apparently not correct but I cannot figure out why.</p>
  
  <p><code>b.h</code> gets called first, and it is 44 then b.getH() is called and it prints "Beta 44". So the console          prints <code>44 Beta 44</code>. Why is it not the case? </p>
  
  <pre><code>public class Beta {
  
      public int h = 44;
      public int getH(){
          System.out.println("Beta "+h);
          return h;
      }
      public static void main(String[] args) {
          Beta b = new Beta();
          System.out.println(b.h+" "+ b.getH());
      }
  
  }
  </code></pre>