QUESTION NO 51.doc


文档分类:通信/电子 | 页数:约21页 举报非法文档有奖
1/21
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/21
文档列表 文档介绍
QUESTION NO: 51
Which two create an instance of an array? (Choose two)
A. int[] ia = new int[15];
B. float fa = new float[20];
C. char[] ca = “Some String”;
D. Object oa = new float[20];
E. int ia[][] = { 4, 5, 6, }, { 1, 2, 3 };
Answer: A, D
Key:考点:关于数组的声明以及实例化。
QUESTION NO: 52
Given:
1. class Super {
2. public int getLenght() { return 4; }
3. }
4.
5. public class Sub extends Super {
6. public long getLenght() { return 5; }
7.
8. public static void main(String[] args) {
9. Super sooper = new Super();
10. Sub sub = new Sub();
11. (
12. () + “,”+ () );
13. }
14. }
What is the output?
A. 4,4
B. 4,5
C. 5,4
D. 5,5
E. Compilation fails.
Answer: E
Key:关于方法的覆盖,返回类型必须一样。
QUESTION NO: 53
Given:
1. public class Test {
2. public static void main(String[] args) {
3. int x = 0;
4. assert (x > 0): “assertion failed”;
5. (“finished”);
6. }
7. }
What is the result?
A. finished
B. Compilation fails.
C. An AssertionError is thrown.
D. An AssertionError is thrown and finished is output.
Answer: A
Key:This question is a bit tricky because it lacks the following information: It should include a
statement that says whether or not assertions are enabled. If they are indeed enabled, the
correction answer is C. but if they are not, the correct answer is A. Assertions are not enabled, by default so if the question is not changed, the most logical answer is A.
断言在默认设置下是不启用的。
QUESTION NO: 54
You want to limit access to a method of a public class to members of the same class.
Which access plishes this objective?
A. public
B. private
C. protected
D. transient
E. default access
Answer: B
Key:考点是四种访问级别,在同一个类的访问是private。
QUESTION NO: 55
Given:
11. switch(x) {
12. default:
13. (“Hello”);
14. }
Which two are acceptable types for x? (Choose two)
A. byte
B. long
C. char
D. float
E. Short
F. Long
Answer: A, C
Key:swtich()里面是基本类型变量,E,F错误。其次要可以自动转

QUESTION NO 51 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数21
  • 收藏数0 收藏
  • 顶次数0
  • 上传人653072647
  • 文件大小102 KB
  • 时间2018-11-10