Home » Oracle » 1z0-803 » Which statement is true about the default constructor of a top-level class?
Which statement is true about the default constructor of a top-level class?
A. It can take arguments.
B. It has private access modifier in its declaration.
C. It can be overloaded.
D. The default constructor of a subclass always invokes the no-argument constructor of its superclass.
Correct Answer: D
Explanation/Reference:
In both Java and C#, a "default constructor" refers to a nullary constructor that is automatically generated by the compiler if no constructors have been defined for the class. The default constructor is also empty, meaning that it does nothing. A programmer-defined constructor that takes no parameters is also called a default constructor.
Download Printable PDF. VALID exam to help you PASS.
|
|