格林模拟试题一参考答案

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

 

answer 35)

4) compile time error
 

the only operator overloading offered by java is the + sign for the string class. a char is a 16 bit integer and cannot be concatenated to a string with the + operator.


answer 36)

3) if(s.equalsignorecase(s2))

string comparison is case sensitive so using the equals string method will not return a match. using the==operator just compares where memory address of the references and nocasematch was just something i made up to give me a fourth slightly plausible option.


answer 37)

1) s.setbackground(color.pink);

for speakers of the more british spelt english note that there is no letter u in color. also the constants for colors are in lower case.


answer 38)

4) the file class does not support directly changing the current directory.

this seems rather surprising to me, as changing the current directory is a very common requirement. you may be able to get around this limitation by creating a new instance of the file class passing the new directory to the constructor as the path name.


answer 39)

1)with a fixed font you will see 5 characters, with a  proportional it will depend on the width of the characters

with a proportional font the letter w will occupy more space than the letter i. so if you have all wide characters you may have to scroll to the right to see the entire text of a textfield.


answer 40)

3) on the line after //two put super(10);

constructors can only be invoked from within constructors.

视频学习

我考网版权与免责声明

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

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

最近更新

社区交流

考试问答