格林模拟试题二参考答案

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

 

answer 48)

2)s+=i;

only a string acts as if the + operator were overloaded


answer 49)

although the objectives do not specifically mention the need to understand the i/o classes, feedback from people who have taken the exam indicate that you will get questions on this topic. as you will probably need to know this in the real world of java programming, get familiar with the basics. i have assigned these questions to objective 10.1 as that is a fairly vague objective.

1) file f = new file("/","autoexec.bat");
2) datainputstream d = new datainputstream(system.in);
3) outputstreamwriter o = new outputstreamwriter(system.out);

option 4, with the randomaccess file will not compile because the constructor must also be passed a mode parameter which must be either "r" or "rw"


answer 50)

1)o1=o2;

2)b=ob;

4)o1=b;

answer 51)

4) 10020

in the call

another(v,i);

a reference to v is passed and thus any changes will be intact after this call.


answer 52)

1) public void amethod(string s, int i){}
4) public void amethod(int i, string s) {}

overloaded methods are differentiated only on the number, type and order of parameters, not on the return type of the method or the names of the parameters.


answer 53)


4)base b = new base(10);

any call to this or super must be the first line in a constructor. as the method already has a call to this, no more can be inserted.



answer 54)

1) system.out.println(s);
4) system.out.println(iargs);

a class within a method can only see final variables of the enclosing method. however it the normal visibility rules apply for variables outside the enclosing method.

视频学习

我考网版权与免责声明

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

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

最近更新

社区交流

考试问答