title: Java abstract class constructor
body: <p>I'm wondering what is happening here:</p>
  
  <p>I have abstract superclass</p>
  
  <pre><code>public abstract class Superclass {
    public Superclass()
    {
          doSth();
    }
    public abstract void doSth();
  }
  </code></pre>
  
  <p>And subclass</p>
  
  <pre><code>public class Subclass extends Superclass{
     private int x = 10;
     public void doSth()
     {
        System.out.println("Value x="+this.x);        
     }    
  }
  </code></pre>
  
  <p>When I make</p>
  
  <pre><code>Subclass x= new Subclass();
  x.doSth();
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>Value x=0
  Value x=10
  </code></pre>
  
  <p>I don't know why first I get x=0 (why not x=10 from the start?) and then x=10?</p>