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

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

 

answer to question 39)

4) the code will compile without error

there are no restrictions on the level of nesting for inner/nested classes. inner classes may be marked private. the main method is not declared as public static void main, and assuming that the commandline was java droitwich it would not be invoked anyway.


answer to question 40)

1) super.oak=1;
2) oak=33;
3) base.oak=22;

because the variable oak is declared as static only one copy of it will exist. thus it can be changed either through the name of its class or through the name of any instance of that class. because it is created as an integer it canot be assigned a fractional component without a cast.


answer to question 41)

obje question 41)

4) use the gettext method of a textfield and use the parseint method of the integer class

here is an example of how you might do this

integer.parseint(txtinputvalue.gettext());

i'm not sure that a question on this actually will come up in the exam but it is a very useful thing to know in the real world.


answer to question 42)

4) none of the above

the wrapper classes are immutable. once the value has been set it cannot be changed. a common use of the wrapper classes is to take advantage of their static methods such as integer.parseint(string s) that will returns an integer if the the value has been set it cannot be changed. a common use of the wrapper classes is to take advantage of their static methods such as integer.parseint(string s) that will returns an integer if the string contains one.

上一页123下一页

视频学习

我考网版权与免责声明

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

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

最近更新

社区交流

考试问答