请教一个关于java的英文题目.“1.Which of the following stat”

请教一个关于java的英文题目.“1.Which of the following stat”
1.Which of the following statements is true about constructors?
a) A constructor must be listed straight after the fields.
b) A constructor must have no parameters.
c) A class can have only one constructor.
d) A class can have any number of constructors.
e) A constructor returns a pointer to the class.
1d
能不能简单说明一下为什么其他的选项不对?
其他人气:847 ℃时间:2020-04-04 11:54:19
优质解答
a)构造方法必须被直接在字段后列出来.(可以在最前面.)
b) 构造方法必须没有参数.(可以无参、可以有参.)
c) 一个类只能有一个构造方法.(可以一个、可以有多个、也可以没有.)
d) 一个类能有好几个构造方法.(对)
e)构造方法返回一个指针给类.(通常是初始化各种数据,不会返回一个指针.)
我来回答
类似推荐
请使用1024x768 IE6.0或更高版本浏览器浏览本站点,以保证最佳阅读效果。本页提供作业小助手,一起搜作业以及作业好帮手最新版!
版权所有 CopyRight © 2012-2024 作业小助手 All Rights Reserved. 手机版