SCJP试题-SCJPMockExam1

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


Q40
Which of these statements concerning the collection interfaces are true?

1) Set extends Collection.
2) All methods defined in Set are also defined in Collection.
3) List extends Collection.
4) All methods defined in List are also defined in Collection.
5) Map extends Collection.

Q41
What is the name of the method that threads can use to pause their execution until signalled to continue by another thread?

Fill in the name of the method (do not include a parameter list).

Q42
Given the following class definitions, which expression identifies whether the object referred to by obj was created by instantiating class B rather than classes A, C and D?

class A {}
class B extends A {}
class C extends B {}
class D extends A {}

1) obj instanceof B
2) obj instanceof A && ! (obj instanceof C)
3) obj instanceof B && ! (obj instanceof C)
4) obj instanceof C || obj instanceof D
5) (obj instanceof A) && ! (obj instanceof C) && ! (obj instanceof D)

Q43
What will be written to the standard output when the following program is run?

public class Q8499 {
public static void main(String args[]) {
double d = -2.9;
int i = (int) d;
i *= (int) Math.ceil(d);
i *= (int) Math.abs(d);
System.out.println(i);
}
}

1) 12
2) 18
3) 8
4) 12
5) 27

Q44
What will be written to the standard output when the following program is run?

public class Qcb90 {
int a;
int b;
public void f() {
a = 0;
b = 0;
int[] c = { 0 };
g(b, c);
System.out.println(a + " " + b + " " + c[0] + " ");
}
public void g(int b, int[] c) {
a = 1;
b = 1;
c[0] = 1;
}
public static void main(String args[]) {
Qcb90 obj = new Qcb90();
obj.f();
}
}

1) 0 0 0
2) 0 0 1
3) 0 1 0
4) 1 0 0
5) 1 0 1

视频学习

我考网版权与免责声明

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

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

最近更新

社区交流

考试问答