QUESTION 41
Given the exhibit:
What is the result when this code executed?
A. 1
B. 3
C. 123
D. 321
E. The code runs with no output
Answer: ( C )
子类先调用父类的构造函数,在调用自己的构造函数;
参考大纲:Java语言基础 —继承和构造函数
QUESTION 42
Place the code fragments in position to complete the Displayable interface.
Answer: ( )
interface Displayable extends Reloadable{
public void display();
}
参考大纲:面向对象 — 接口继承
QUESTION 43
Given the exhibit:
Which code, inserted at line 14, allows the Sprite class to compile?
A. Direction d = NORTH
B. Certkiller .Direction d = NORTH
C. Direction d = Direction.NORTH
D. Certkiller .Direction d = Certkiller .Direction. NORTH
Answer: ( D )
enum枚举关键字
一个enum就像一个class,因此参照内部类的使用方法选择D
参考大纲:面向对象 — enum类型
QUESTION 44
Exhibit:
Which three statements are true? (Choose three)
A. Compilation fails
B. The code compiles and the output is 2。
C. If lines 16, 17 and 18 were removed, compilation would fail.
D. If lines 24,25, and 26 were removed, compilation would fail.
E. If lines 16,17 and 18 were removed, the code would compile and the output would be 2.
F. If line 24,25 and 26 were removed, the code would compile and the output would be 1.
Answer: ( B,E,F )
一个内部类Class A,一个方法内部类Class A
参考大纲:面向对象
QUESTION 45
Add methods to the Beta class to make it compile correctly.
Answer: ( )
public class Beata extends Alpha{
public void bar(int x){}
public int bar(String x){return 1;}
public void bar(int x, int y){}
}
private void bar(int x){} 错误 覆写时存取权限不可以小于原方法
public void bar(int x){} 正确 覆写
public int bar(String x){return l;} 正确 覆载
public Alpha bar(int x){int x}{} 错误 覆写时的传回值可以与原来的方法返回值相等或者是子类别,本例中原来的返回是void,这样子类别中只能用void来修饰bar()方法。
public void bar(int x, int y){} 正确 覆载
public int bar(int x){return x;} 错误 覆载
参考大纲:面向对象 — 覆写和覆载
分享到:
相关推荐
scjp题库scjp题库scjp题库scjp题库scjp题库scjp题库scjp题库scjp题库scjp题库scjp题库
scjp题库scjp题库scjp题库scjp题库scjp题库scjp题库 java题库java题库java题库java题库java题库java题库
sun公司scjp认证题库 短小精悍,覆盖面强,摒弃题海,专注重要的知识点
最新题库,含200多道真题,做完这个题库的题,过scjp基本没问题
scjp题库(收集了CSDN上大部分题库,近1000道SCJP试题 看看大小就知道了,.jar文件直接双击打开
java scjp认证考试题库 都有答案 慢慢我会把注释也加上的
SCJP轻松过 SCJP学习指南 SCJP试题 scjp题库
背下来就好了,哈哈SCJP题库,有了它必过SCJP题库,有了它必过SCJP题库,有了它必过SCJP题库,有了它必过
SCJP最新题库,正式考试时很多题都是原题,不是原题的很多题也类似,如果你搞懂了这里的所有题,你肯定能过,我考了95%
scjp
当时参加scjp考前培训时,老师给我们的题库。考试时的题目上面基本都有,做一遍考试过绝对没问题。
内含多套试题、scjp测试模拟器等 内含多套试题、scjp测试模拟器等
java题库+scjp模拟题。希望对你有帮助
通过SCJP的捷径~我考了70分!想要考或者准备考SCJP的朋友来看看吧!有答案!
2010年SCJP标准题库-jdk1.5
这是最新的SCJP考试题库,有答案,把这过一遍,考试肯定过!
ocjp认证。适合有一定java基础的人看。里面的题比较偏重底层
2013 年 最新SCJP 考试题库。全英文题目