0
public abstract class AbstractObject {
    AbstractObject(){
        System.out.println("mahi2");
    }
}

class PrintMahi extends AbstractObject{
    public static  void main(String ... args){
        PrintMahi m = new PrintMahi();
    }
}

In above code I understand that the PrintMahi object is getting created and because of inheritance superclass which is abstract in this case constructor is getting called. So is it like that the abstract class object is being created here?

Michu93
  • 5,058
  • 7
  • 47
  • 80
mahi
  • 84
  • 1
  • 5
  • No, the concrete class `printMahi`is getting created. The abstract superclass part of it is being initialized along the way. – daniu May 08 '18 at 21:01
  • Possible duplicate of [Why do this() and super() have to be the first statement in a constructor?](https://stackoverflow.com/questions/1168345/why-do-this-and-super-have-to-be-the-first-statement-in-a-constructor) – Yassin Hajaj May 08 '18 at 21:04

0 Answers0