- 讲师:刘萍萍 / 谢楠
- 课时:160h
- 价格 4580 元
特色双名师解密新课程高频考点,送国家电网教材讲义,助力一次通关
配套通关班送国网在线题库一套
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
责编:罗莉
上一篇:格林模拟试题三参考答案(2)
下一篇:格林模拟试题三参考答案(4)
课程专业名称 |
讲师 |
课时 |
查看课程 |
---|
课程专业名称 |
讲师 |
课时 |
查看课程 |
---|
点击加载更多评论>>