)92-147/147的文章 name=description>


SCJP考试题310-025(第二套<4>)92-147/147
来源:优易学  2011-9-22 20:30:08   【优易学:中国教育考试门户网】   资料下载   IT书店

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

上一页  [1] [2] [3] [4] [5] [6] [7] [8] 下一页

责任编辑:小草

文章搜索:
 相关文章
热点资讯
资讯快报
热门课程培训