考试网 >> IT认证 >> JAVA >> JAVA题库 >> 格林模拟试题二参考答案

格林模拟试题二参考答案

发布时间:2006-06-28 10:52     点击:
分页:[1] 2 3 4 5 6 7 8 9 10  下一页  后10页

Answers


Answer 1)

1) The code will compile and run, printing out the words "My Func"

A class that contains an abstract method must be declared abstract itself, but may contain non abstract methods.


Answer 2)

4) The code will compile but will complain at run time that main is not correctly defined

In this example the parameter is a string not a string array as needed for the correct main method


Answer 3)

1) public

2) private

4) transient

The keyword transient is easy to forget as is not frequently used. Although a method may be considered to be friendly like in C++ it is not a Java keyword.


Answer 4)

2) The compiler will complain that the Base class is not declared as abstract.

If a class contains abstract methods it must itself be declared as abstract


Answer 5)

1) To get to access hardware that Java does not know about

3) To write optimised code for performance in a language such as C/C++


Answer 6)

4) Success in compilation and output of "amethod" at run time.

A final method cannot be ovverriden in a sub class, but apart from that it does not cause any other restrictions.


Answer 7)

4) Compilation and execution without error

It would cause a run time error if you had a call to amethod though.

分页:[1] 2 3 4 5 6 7 8 9 10  下一页  后10页
版权申明:未经书面授权请勿转载本站信息!!作品版权归所属媒体与作者所有!!
发表评论: 匿名发表 用户名: 查看评论
您将承担一切因您的行为、言论而直接或间接导致的民事或刑事法律责任
留言板管理人员有权保留或删除其管辖留言中的任意内容
本站提醒:不要进行人身攻击。谢谢配合。
在本站搜索相关信息
2003-2005 Ksw123.com All Rights Reserved. - TOP
Copyright © 2006 Ksw123.com. All rights reserved.中国考题网 版权所有