title: Sometime it creates an error because there is no constructor and sometimes it's OK
body: <p>Why does this code fail to compile with "Apple needs a constructor"?</p>
  
  <pre><code>class Fruit {
    public Fruit(String name) {
      System.out.println("Fruit's constructor is invoked");
    }
  }
  
  public class Apple extends Fruit {}
  </code></pre>
  
  <p>This code has a class without constructor (GraduateStudent) and it's OK?</p>
  
  <pre><code>public class Demo{
    public static void main(String[] args) {
      m(new GraduateStudent());
      m(new Student());
      m(new Person());
      m(new Object());
    }
  
    public static void m(Object x) {
      System.out.println(x.toString());
    }
  }
  
  class GraduateStudent extends Student {
  }
  
  class Student extends Person {
    public String toString() {
      return "Student";
    }
  }
  
  class Person extends Object {
    public String toString() {
      return "Person";
    }
  }
  </code></pre>