Question: Which of the following statements is true? Select the one correct answer. (a) A super() or this() call must always be provided explicitly as the
Which of the following statements is true?
Select the one correct answer.
(a) A super() or this() call must always be provided explicitly as the first statement in the body of a constructor.
(b) If both a subclass and its superclass do not have any declared constructors, the implicit default constructor of the subclass will call super() when run.
(c) If neither super() nor this() is specified as the first statement in the body of a constructor, this() will implicitly be inserted as the first statement.
(d) If super() is the first statement in the body of a constructor, this() can be declared as the second statement.
(e) Calling super() as the first statement in the body of a constructor of a subclass will always work, since all superclasses have a default constructor.
Step by Step Solution
There are 3 Steps involved in it
b In a subclass without any declared constructors ... View full answer
Get step-by-step solutions from verified subject matter experts
