title: Using reference to "this" object from member variable
body: <p>I am asked to say what does this code do but I really cannot figure it out.
  I've tried to execute it in netbeans and got the answer <code>6</code> but really cannot understand why.</p>
  
  <pre><code>public class Quattro {
      int x = 5;
      Quattro s = this;
      Quattro f(){
          s.s.s.x++;
          return s;
      }
      void g(){System.out.println(x);}
      public static void main (String[] args){
          Quattro a4 = new Quattro();
          a4.f().g();
      }
  }
  </code></pre>
  
  <p><strong>Question 1:</strong> What does <code>Quattro s = this;</code> do? Am I declarind a pointer to my self? If so, it means that I can write </p>
  
  <pre><code>Quattro f(){
              s.s.s.x++;
              return s;
          }
  </code></pre>
  
  <p>or even</p>
  
  <pre><code>Quattro f(){
              s.s.s.s.s.s.s.s.x++;
              return s;
          }
  </code></pre>
  
  <p>and I'll always get the same result because I'm in a loop?</p>
  
  <p><strong>Question 2</strong>: I do not understand what <code>a4.f().g();</code> does... seems so weird to me.</p>