answering to why we get Main m1 and A constructor .After inheriting if we execute class Main(i.e. java Main). We get class Main members as instance block {m1();} constructor A() and object of Class Main (i.e. Main m = new Main()) ,method m1()(i.e. overridden and now it's output is (Main m1)).The control flow is from first block { m1();} executed but m1(); is overridden so we get "Main m1"and then constructor A(){} is executed so we get "A constructor".