KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务
Exam : 310-065Big5 Title : Sun Certified Programmer for the Java 2 Platform, SE 6.0 Version : Demo 1 / 14
1. 35. String #name = "Jane Doe"; 36. int $age = 24; 37. Double _height = 123.5; 38. double ~temp = 37.5; ( ) A. 35 B. 36 C. 37 D. 38 Answer: AD 2. 11. public static Iterator reverse(list list) { 12. Collections.reverse(list); 13. return list.iterator(); 14. } 15. public static void main(string[] args) { 16. List list = new ArrayList(); 17. list.add("1"); list.add("2"); list.add("3"); 18. for (Object obj: reverse(list)) 19. System.out.print(obj + ", "); 20. } A. 3, 2, 1, B. 1, 2, 3, C. D. E. Answer: C 2 / 14
3. 5. class A { 6. void foo() throws Exception { throw new Exception(); } 7. } 8. class SubB2 extends A { 9. void foo() { System.out.println("B "); } 10. } 11. class Tester { 12. public static void main(string[] args) { 13. A a = new SubB2(); 14. a.foo(); 15. } 16. } A. B B. B Exception C. 9 D. 14 E. Exception Answer: D 4. 1. public class TestString3 { 2. public static void main(string[] args) { 3. // insert code here 5. System.out.println(s); 6. } 7. } 3 4247 ( ) 3 / 14
A. String s = "123456789"; s = (s-"123").replace(1,3,"24") - "89"; B. StringBuffer s = new StringBuffer("123456789"); s.delete(0,3).replace(1,3,"24").delete(4,6); C. StringBuffer s = new StringBuffer("123456789"); s.substring(3,6).delete(1,3).insert(1, "24"); D. StringBuilder s = new StringBuilder("123456789"); s.substring(3,6).delete(1,2).insert(1, "24"); E. StringBuilder s = new StringBuilder("123456789"); s.delete(0,3).delete(1,3).delete(2,5).insert(1, "24"); Answer: BE 5. 10. import java.io.*; 11. class Animal { 12. Animal() { System.out.print("a"); } 13. } 14. class Dog extends Animal implements Serializable { 15. Dog() { System.out.print("d"); } 16. } 17. public class Beagle extends Dog { } Beagle Serialized deserialized A. ad B. ada C. add D. adad E. F. Answer: B 4 / 14
6. 1. public class LineUp { 2. public static void main(string[] args) { 3. double d = 12.345; 4. // insert code here 5. } 6. } 4 12.345 A. System.out.printf(" %7d \n", d); B. System.out.printf(" %7f \n", d); C. System.out.printf(" %3.7d \n", d); D. System.out.printf(" %3.7f \n", d); E. System.out.printf(" %7.3d \n", d); F. System.out.printf(" %7.3f \n", d); Answer: F 7. ( ) A. private synchronized Object o; B. void go() { synchronized() { /* code here */ } } C. public synchronized void go() { /* code here */ } D. private synchronized(this) void go() { /* code here */ } E. void go() { synchronized(object.class) { /* code here */ } } F. void go() { Object o = new Object(); synchronized(o) { /* code here */ } } 5 / 14
Answer: CEF 8. API API A. B. C. D. E. F. Answer: A 9. 2. public class Hi { 3. void m1() { } 4. protected void() m2 { } 5. } 6. class Lois extends Hi { 7. // insert code here 8. } 7 ( ) A. public void m1() { } B. protected void m1() { } C. private void m1() { } D. void m2() { } E. public void m2() { } F. protected void m2() { } G. private void m2() { } Answer: ABEF 6 / 14
10. 1. import java.util.*; 2. public class Example { 3. public static void main(string[] args) { 4. // insert code here 5. set.add(new Integer(2)); 6. set.add(new Integer(1)); 7. System.out.println(set); 8. } 9. } 4 [1, 2] A. Set set = new TreeSet(); B. Set set = new HashSet(); C. Set set = new SortedSet(); D. List set = new SortedList(); E. Set set = new LinkedHashSet(); Answer: A 11. 1. import java.util.*; 2. 3. public class LetterASort{ 4. public static void main(string[] args) { 5. ArrayList<String> strings = new ArrayList<String>(); 6. strings.add("aaaa"); 7. strings.add("aaa"); 8. strings.add("aaa"); 9. strings.add("aaaa"); 10. Collections.sort(strings); 7 / 14
11. for (String s : strings) { System.out.print(s + " "); } 12. } 13. } A. B. aaaa aaa AAaa AaA C. AAaa AaA aaa aaaa D. AaA AAaa aaaa aaa E. aaa AaA aaaa AAaa F. Answer: C 12. bigproject --source --Utils.java --classes -- javac -d classes source/utils.java bigproject A. Utils.class B. C. Utils.class D. Utils.class bigproject Answer: C 13. 10. package com.sun.scjp; 8 / 14
11. public class Geodetics { 12. public static final double DIAMETER = 12756.32; // kilometers 13. } Geodetics DIAMETER ( ) A. import com.sun.scjp.geodetics; public class TerraCarta { public double halfway() { return Geodetics.DIAMETER/2.0; } } B. import static com.sun.scjp.geodetics; public class TerraCarta{ public double halfway() { return DIAMETER/2.0; } } C. import static com.sun.scjp.geodetics.*; public class TerraCarta { public double halfway() { return DIAMETER/2.0; } } D. package com.sun.scjp; public class TerraCarta { public double halfway() { return DIAMETER/2.0; } } Answer: AC 14. 10. class Nav{ 11. public enum Direction { NORTH, SOUTH, EAST, WEST } 12. } 13. public class Sprite{ 14. // insert code here 15. } 14 Sprite A. Direction d = NORTH; B. Nav.Direction d = NORTH; C. Direction d = Direction.NORTH; 9 / 14
D. Nav.Direction d = Nav.Direction.NORTH; Answer: D 15. 10. interface Foo { int bar(); } 11. public class Sprite { 12. public int fubar( Foo foo ) { return foo.bar(); } 13. public void testfoo() { 14. fubar( 15. // insert code here 16. ); 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 16. [ ] 10. interface Foo { 11. int bar(); 12. } 13. 14. public class Beta { 15. 16. class A implements Foo { 17. public int bar() { return 1; } 18. } 10 / 14
19. 20. public int fubar( Foo foo ) { return foo.bar(); } 21. 22. public void testfoo() { 23. 24. class A implements Foo { 25. public int bar() { return 2; } 26. } 27. 28. System.out.println( fubar( new A() ) ); 29. } 30. 31. public static void main( String[] argv ) { 32. new Beta().testFoo(); 33. } 34. } ( ) A. B. 2 C. 16 17 18 D. 24 25 26 E. 16 17 18 2 F. 24 25 26 1 Answer: BEF 17. 1. class TestA { 2. public void start() { System.out.println("TestA"); } 3. } 4. public class TestB extends TestA { 11 / 14
5. public void start() { System.out.println("TestB"); } 6. public static void main(string[] args) { 7. ((TestA)new TestB()).start(); 8. } 9. } A. TestA B. TestB C. D. Answer: B 18. 1. interface TestA { String tostring(); } 2. public class Test { 3. public static void main(string[] args) { 4. System.out.println(new TestA() { 5. public String tostring() { return "test"; } 6. }); 7. }); 8. });? A. test B. null C. D. 1 E. 4 F. 5 Answer: A 12 / 14
19. 11. public interface A111 { 12. String s = "yo"; 13. public void method1(); 14. } 17. interface B { } 20. interface C extends A111, B { 21. public void method1(); 22. public void method1(int x); 23. } A. B. C. 20 D. 21 E. 22 F. 12 Answer: A 20. 11. public interface A { public void m1(); } 12. 13. class B implements A { } 14. class C implements A { public void m1() { } } 15. class D implements A { public void m1(int x) { } } 16. abstract class E implements A { } 17. abstract class F implements A { public void m1() { } } 18. abstract class G implements A { public void m1(int x) { } } A. 13 / 14
B. C. D. E. Answer: C 14 / 14