public class Base {
public Base() { System.out.print("B "); }
}
public class Child extends Base {
public Child() { System.out.print("C "); }
}
// ...
new Child();What is printed?
- A
B
- B
C
- C
C B
- Dcheck_circle
B C
Explanation
Java implicitly calls super() before the body of the subclass constructor, so Base prints first.