Why should I call super() in Java?
问题 I see an example from a book that I read about java: public class A{ public A(){ System.out.println("A"); } } public class B extends A{ public B(){ super(); System.out.println("B"); } public static void main(String[] args){ B b = new B(); } } I can't understand why should super() be here? Even if I delete super() , I would get the same result (A would be printed, and then B). As I understand, when I initialize the subclass, then the parent class is initialize before it. So why use super() ?