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

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


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

上一页456下一页

视频学习

我考网版权与免责声明

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

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

最近更新

社区交流

考试问答