- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
QUESTION 121
Given:
Which code, inserted at line 15, creates an instance of the Point class defined in Line?
A. Point p new Point ;
B. Line.Point p new Line.point ;
C. The Point class cannot be instatiated at line 15.
D. Line 1 new Line ; 1.Point p new 1.Point ;
Answer: B
静态内部类创建方法 非静态内部类的构造:Line.Point p new Line .new Point ;
参考大纲:面向对象 — 内部静态类
QUESTION 122
Given:
Which statement is true?
A. The code will compile without changes.
B. The code will compile if public Tree Plant ; is added to the Tree class.
C. The code will compile if public Plant Tree ; is added to the Plant class.
D. The code will compile if public Plant this fern ; is added to the Plant class.
E. The code will compile if public Plant Plant fern ; is added to the Plant class.
Answer: D
子类默认调用父类无参构造函数,而Plant没有无参构造函数,因此须显示调用有参构造函数
参考大纲:面向对象
QUESTION 123
Given:
Which two code fragments, inserted independently at line 12, will allow the class to compile? Choose two.
A. foreach x Syt1n z ;
B. for int z : x Syt1n z ;
C. while x.hashNext Syt1n x.next
D. for int i 0; i x.length; i++ Sytln x[i] ;
Answer: B, D
可变参数方法编译后变成数组参数方法,然后利用循环结构取出数组的值
参考大纲:流程控制和可变长度参数
QUESTION 124
Exhibit:
Which statement is true about the classes and interfaces in the exhibit?
A. Compilation will succeed for all classes and interfaces.
B. Compilation of class C will fail because of an error in line 2.
C. Compilation of class C will fail because of an error in line 6.
D. Compilation of class AImpl will fail because of an error in line 2.
Answer: C
参考大纲:面向对象 — 复写
QUESTION 125
Place the lines in the correct order to complete the enum。
enum Element
Answer:
enum Element
EARTH, WIND,
FIRE
public String info return “Hot”;
;
public String info return “element”;
列举的内容之后要加上“;”
参考大纲:面向对象 — enum
QUESTION 126
Place the code elements in order so that the resulting Java source file will compile
correctly, res
文档评论(0)