求教!

dulang200x 2003-10-16 03:34:46
有道题目有分歧!
Which two statements are true regarding the creation of a default constructor? (Choose Two)

A. The default constructor initializes method variables.
B. The compiler always creates a default constructor for every class.
C. The default constructor invokes the no-parameter constructor of the superclass.
D. The default constructor initializes the instance variables declared in the class.
E. When a class has only constructors with parameters, the compiler does not create a default constructor.

我觉得E肯定对的,D中说默认构造器初始化事例变量也应该是对的啊?而答案却认为
C是对的!请教高手
...全文
31 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
leaonchen 2003-10-17
  • 打赏
  • 举报
回复
DE
regnay 2003-10-16
  • 打赏
  • 举报
回复
默认构造器又不是你写的构造器。

50,503

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧