310-055Big5 SCJP Braindump
ExamSoon 310-055Big5 Exams
SUN Sun Certified Programmer for the Java 2 Platform.SE 5.0
O rder : 310-055Big5 Exam
Practice Exam: 310-055Big5
Exam Number/Code: 310-055Big5
Exam Name: Sun Certified Programmer for the Java 2 Platform.SE 5.0
Questions and Answers: 259 Q&As
Free 310-055Big5 Braindumps
Exam : SUN 310-055Big5
Title : Sun Certified Programmer for the Java 2 Platform.SE 5.0
1. 現有:
10: public class Hello {
11: String title;
12: int value;
13: public Hello() {
14: title += " World";
15: }
16: public Hello(int value) {
17: this.value = value;
18: title = "Hello";
19: Hello();
20: }
21: }
以及:
30: Hello c = new Hello(5);
31: System.out.println(c.title);
結果為何?
A. Hello
B. Hello World
C. 編譯失敗。
D. Hello World 5
E. 這個程式碼可以執行,但沒有輸出。
F. 在執行時期丟出了一個例外。
Answer: C
2. );
17. }
18. }
第15行插入哪一項程式碼後,可讓Sprite類別編譯?
A. Foo { public int bar() { return 1; } }
B. new Foo { public int bar() { return 1; } }
C. new Foo() { public int bar() { return 1; } }
D. new class Foo { public int bar() { return 1; } }
Answer: C
3. // insert code here
15. }
第14行加入哪一項程式碼後,可讓Sprite類別編譯?
A. Direction d = NORTH;
B. Nav.Direction d = NORTH;
C. Direction d = Direction.NORTH;
D. Nav.Direction d = Nav.Direction.NORTH;
Answer: D
4. }
18. }
第15行插入哪一項程式碼後,可讓Sprite類別編譯?
A. Foo { public int bar() { return 1; } }
B. new Foo { public int bar() { return 1; } }
C. new Foo() { public int bar() { return 1; } }
D. new class Foo { public int bar() { return 1; } }
Answer: C
5. 現有:
11. public static void parse(String str) {
12. try {
13. float f = Float.parseFloat(str);
14. } catch (NumberFormatException nfe) {
15. f = 0;
16. } finally {
17. System.out.println(f);
18. }
19. }
20. public static void main(String [] args) {
21. parse("invalid");
22. }
結果為何?
A. 0.0
B. 編譯失敗。
C. 在執行時期parse方法會丟出一個ParseException。
D. 在執行時期parse方法會丟出一個NumberFormatException。
Answer: B
6. 現有:
11. public interface Status {
12. /* insert code here */ int MY_VALUE = 10;
13. }
哪三項在第12行有效?(選擇三項。)
A. final
B. static
C. native
D. public
E. pr