)51-91/147的文章 name=description>


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

 

QUESTION NO: 87
Given:
1. public class Test {
2. public static void main (String[]args) {
3. String foo = args[1];
4. String bar = args[2];
5. String baz = args[3];
6. System.out.printIn(“baz = ” + baz);
7. }
8. }
And the output:
Baz = 2
Which command line invocation will produce the output?
A. Java Test 2222
B. Java Test 1 2 3 4
C. Java Test 4 2 4 2
D. Java Test 4 3 2 1
Answer: C

QUESTION NO: 88
Given:
8. int index = 1;
9. String [] test = new String[3];
10. String foo = test[index];
What is the result?
E. Foo has the value “”
B. Foo has the value null
C. An exception is thrown
D. The code will not compile
Answer: B
QUESTION NO: 89
Given:
1. public interface Foo{
2. int k = 4;
3. }
Which three are equivalent to line 2? (Choose Three)
A. Final int k = 4;
B. Public int k = 4;
C. Static int k = 4;
D. Private int k = 4;
E. Abstract int k = 4;
F. Volatile int k = 4;
G. Transient int k = 4;
H. Protected int k = 4;
Answer: A, B, C
QUESTION NO: 90
Given:
310-025
Leading the way in IT testing and certification tools, www.testking.com
- 48 -
1. public class foo {
2. static String s;
3. public static void main (String[]args) {
4. system.out.printIn (“s=” + s);
5. }
6. }
What is the result?
A. The code compiles and “s=” is printed.
B. The code compiles and “s=null” is printed.
C. The code does not compile because string s is not initialized.
D. The code does not compile because string s cannot be referenced.
E. The code compiles, but a NullPointerException is thrown when toString is called.
Answer: B
QUESTION NO: 91
Which two valid declarations of a char? (Choose Two)
A. Char ch = “a”;
B. Char ch = ‘\' ‘;
C. Char ch = ‘cafe';
D. Char ch = “cafe”;
E. Char ch = ‘\ucafe';
F. Char ch = ‘\u10100';
G. Char ch = (char) true;
Answer: B, E

上一页  [1] [2] [3] [4] [5] [6] 

责任编辑:小草

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