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.

題解

選項A,預設的建構子不能傳入引數。

選項B,預設的建構子是以public來修飾。

選項C,建構子不能被覆寫。

選項D,預設的建構子預設會去呼叫上層無參數的建構子。例如A類別的預設建構子,自動產生的程式碼如下: