answer: C
Automatic invocation of a superclass constructor must be the first line in the subclass constructor.
Doesn't matter parameterized or not.
//default constructor not inserted
class ConSub
ConSub() {
this(4)
}
//default constructor is inserted
ConSub(int a) {
System.out.println(a);
}
//default constructor not inserted
// default class ConSuper - ok
// protected constructor - ok
class ConSuper {
protected ConSuper() {
this(2);
System.out.println("3");
}
//default constructor is inserted
class ConSuper {
protected ConSuper(int a) {
System.out.println(a);
}
Object default constructor
>2
>23
>234
This section is not available anymore. Please use the main Exam Page.1z0-819 Exam Questions
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.
ASPushkin
7 months, 4 weeks agod7bb0b2
1 year agoTheOneAboveAll
1 year, 3 months agoOmnisumem
1 year, 4 months agoStavok
1 year, 6 months agoObalt
1 year, 11 months ago