格林模拟试题三参考答案(3)

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

 

answer to question 27)

2) output of "hello crowle"

this code is an example of a short circuited operator. because the first operand of the || (or) operator returns true java sees no reason to evaluate the second. whatever the value of the second the overall result will always be true. thus the method called place is never called.


answer to question 28)

4) none of the above;

you may access methods of a direct parent class through the use of super but classes further up the hierarchy are not visible


answer to question 29)

2) a method with the same name completly replaces the functionality of a method earlier in the hierarchy

option 3 is more like a description of overloading. i like to remind myself of the difference between overloading and overriding in that an overriden method is like something overriden in the road, it is squashed, flat no longer used and replaced by something else. an overloaded method has been given extra work to do (it is loaded up with work), but it is still being used in its original format. this is just my little mind trick and doesn't match to anything that java is doing.


answer to question 30)

2) the / operator is used to divide one value by another
3) the # symbol may not be used as the first character of a variable

the % is the modulo operator and returns the remainder after a division. thus 10 % 3=1
the $ symbol may be used as the first character of a variable, but i would suggest that it is generally not a good idea. the # symbol cannot be used anywhere in the name of a variable. knowing if a variable can start with the # or $ characters may seem like arbitrary and non essential knowlege but questions like this do come up on the exam.

上一页123下一页

视频学习

我考网版权与免责声明

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

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

最近更新

社区交流

考试问答