SCJP考试题310-025(第二套)92-147/147

来源:java认证发布时间:2012-11-12 13:05:41java认证视频


QUESTION NO: 109
Given:
1. String foo = “base”;
2. foo.substring(0,3);
3. foo.concat(“ket”);
4. foo += “ball”;
5.
Type the value of foo at line 8.
Answer: BASEBALL
QUESTION NO 110
Given:
1. public class Test {
2. public static void leftshift(int i, int j) {
3. i<<=j;
4. }
5. public static void main(String args[]) {
6. int i = 4, j = 2;
7. leftshift(i, j);
8. System.out.printIn(i);
9. }
10. }
What is the result?
A. 2
B. 4
C. 8
D. 16
E. The code will not compile.
Answer: B
QUESTION NO 111
Given:
1. public class Foo {
2. private int val;
3. public foo(int v) (val = v;) }
4. public static void main (String [] args) {
5. Foo a = new Foo (10);
6. Foo b = new Foo (10);
7. Foo c = a;
8. int d = 10;
9. double e = 10.0;
10. }
11. }
Which three logical expression evaluate to true? (Choose Three)
A. (a ==c)
B. (d ==e)
C. (b ==d)
D. (a ==b)
E. (b ==c)
F. (d ==10.0)
Answer: A, B, F
QUESTION NO 112
Exhibit:
1. public class X {
2. private static int a;
3.
5. public static void main (String[] args) {
6. modify (a);
7. }
8.
9. public static void modify (int a) {
10. a++;
11. }
12. }
What is the result?
A. The program runs and prints “0”
B. The program runs and prints “1”
C. The program runs but aborts with an exception.
D. En error “possible undefined variable” at line 5 causes compilation to fail.
F. En error “possible undefined variable” at line 10 causes compilation to fail.
Answer: A
QUESTION NO 113
Exhibit:
1. public class Test {
2. public static void replaceJ(string text) {
3. text.replace (‘j', ‘l');
4. }
5.
6. public static void main(String args[]) {
7. string text = new String (“java”)
8. replaceJ(text);
9. system.out.printIn(text);
10. }
11. }
What is the result?
A. The program prints “lava”
B. The program prints “java”
C. An error at line 7 causes compilation to fail.
D. Compilation succeeds but the program throws an exception.
Answer: B
QUESTION NO 114
Which two are equivalent? (Choose Two)
A. 3/2
B. 3<2
C. 3*4
D. 3<<2
E. 3*2^2
F. 3<<<2
Answer: C, D
QUESTION NO 115
What is the numerical range of a char?
A. 0 . . . 32767
B. 0 . . . 65535
C. –256 . . . 255
D. –32768 . . . 32767
E. Range is platform dependent.
Answer: B

视频学习

我考网版权与免责声明

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

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

最近更新

社区交流

考试问答