格林模拟试题二参考答案

来源:java认证发布时间:2012-11-12 12:47:44java认证视频

 

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.

上一页123456下一页

视频学习

我考网版权与免责声明

① 凡本网注明稿件来源为"原创"的所有文字、图片和音视频稿件,版权均属本网所有。任何媒体、网站或个人转载、链接转贴或以其他方式复制发表时必须注明"稿件来源:我考网",违者本网将依法追究责任;

② 本网部分稿件来源于网络,任何单位或个人认为我考网发布的内容可能涉嫌侵犯其合法权益,应该及时向我考网书面反馈,并提供身份证明、权属证明及详细侵权情况证明,我考网在收到上述法律文件后,将会尽快移除被控侵权内容。

最近更新

社区交流

考试问答