Answer is C
compiler add super() as first statement in constructor . hence super class constructor gets called and super class initialized before child class
The correct answer is C
class A {
public A() {
System.out.println("A ");
}
}
class B extends A {
public B() {
System.out.println("B ");
}
}
class C extends B {
public C() {
System.out.println("C ");
}
public static void main(String[] args) {
C c = new C();
}
}
correct,
implecit super() method execution before each system.out.println of each constructor
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
M_Jawad
Highly Voted 4 years, 11 months agoM_Jawad
Highly Voted 4 years, 11 months agovic88
Most Recent 2 weeks agoAhmadTechie
1 year agoduydn
1 year, 3 months agoDolly2901
1 year, 5 months agoVicky_65
1 year, 8 months agojjgry
1 year, 9 months agoSSJ5
3 years, 8 months agomete23
4 years, 10 months agov323rs
4 years, 11 months agoMamlouk_Med
5 years, 9 months ago