当前位置:首页 > 全部子站 > IT > 思科认证

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

来源:长理培训发布时间:2017-12-19 10:54:37

 swer 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

the % is the modulo operator and returns the remainder after a division. thus 10 % 3=1

|||

answer to question 31)

1) the default layout manager for an applet is flowlayout

the default layout manager fror an application is borderlayout. an applet will use the default of flowlayout if one is not specifically applied

answer to question 32)

3) only one instance of a static variable will exist for any amount of class instances

option 1) is more a description of a final variable. option 2 is designed to fool visual basic programmers like me as this is how you can use the keyword static in vb. the modifier static can be applied to a class (only an innner class) , method or variable.

answer to question 33)

1) java uses a system called utf for i/o to support international character sets
4) file i/o activities requires use of exception handling

internally java uses unicode which are 16 bit characters. for i/o java uses utf which may be more thatn 16 bits per chamore thatn 16 bits per character.

|||

answer to question 34)

1) compile time error

it wil produce an error like "abstract and native method can't have a body. this is typical of the more misleading question where you might think it is asking you about the circumstances under which the finally clause runs, but actually it is about something else.

answer to question 35)

2) compilation and run with the output "running"

this is perfectly legitimate if useless sample of creating an instnace of a thread and causing its run method to execute via a call to the start method. the thread class is part of the core java.lang package and does not need any explicit import statement. the reference to a thread target is an attempt to mislead with a reference to the method of using the runnable interface instead of simply inheriting from the thread super class.

answer to question 36)

1) randomaccessfile raf=new randomaccessfile("myfile.txt","rw");

the randomaccessfile is an anomaly in the java i/o architecture. it descends directly from object and is not part of the streams architecture

answer to question 37)

2) public int amethod(int i, int j) {return 99;}
4) private void anothermethod(){}

option 1 will not compile on two counts. one is the obvious one that it claims to return an integer. the other is that it is effectivly an attempt to redefine a method within the same class. the change of name of the parameter from i to z has no effect and a method cannot be overriden within the same class.

answer to question 38)

1) code must be written to cause a frame to close on selecting the system close menu
4) the gridbaglayout manager makes extensive use of the the gridbagconstraints class.

you can change the layout manager for a frame or any other container whenever you like

责编:罗莉

发表评论(共0条评论)
请自觉遵守互联网相关政策法规,评论内容只代表网友观点,发表审核后显示!

国家电网校园招聘考试直播课程通关班

  • 讲师:刘萍萍 / 谢楠
  • 课时:160h
  • 价格 4580

特色双名师解密新课程高频考点,送国家电网教材讲义,助力一次通关

配套通关班送国网在线题库一套

课程专业名称
讲师
课时
查看课程

国家电网招聘考试录播视频课程

  • 讲师:崔莹莹 / 刘萍萍
  • 课时:180h
  • 价格 3580

特色解密新课程高频考点,免费学习,助力一次通关

配套全套国网视频课程免费学习

课程专业名称
讲师
课时
查看课程
在线题库
面授课程更多>>
图书商城更多>>
在线报名
  • 报考专业:
    *(必填)
  • 姓名:
    *(必填)
  • 手机号码:
    *(必填)
返回顶部