[Exact] 310-065 SUN pdf exam 81-90 (Jun 2016)

★ Pass on Your First TRY ★ 100% Money Back Guarantee ★ Realistic Practice Exam Questions

Free Instant Download NEW 310-065 Exam Dumps (PDF & VCE):
Available on: https://www.certleader.com/310-065-dumps.html


Exam Code: 310-065 (Practice Exam Latest Test Questions VCE PDF)
Exam Name: Sun Certified Programmer for the Java 2 Platform.SE 6.0
Certification Provider: SUN
Free Today! Guaranteed Training- Pass 310-065 Exam.

2016 Jun 310-065 exam question

Q81. Given: 

1. public class Boxer1{ 

2. Integer i; 

3. int x; 

4. public Boxer1(int y) { 

5. x = i+y; 

6. System.out.println(x); 

7. } 

8. public static void main(String[] args) { 

9. new Boxer1(new Integer(4)); 

10. } 

11. } 

What is the result? 

A. The value "4" is printed at the command line. 

B. Compilation fails because of an error in line 5. 

C. Compilation fails because of an error in line 9. 

D. A NullPointerException occurs at runtime. 

E. A NumberFormatException occurs at runtime. 

F. An IllegalStateException occurs at runtime. 

Answer: D 


Q82. Given: 

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. } 

What is the result? 

A. 3, 2, 1, 

B. 1, 2, 3, 

C. Compilation fails. 

D. The code runs with no output. 

E. An exception is thrown at runtime. 

Answer: C 


Q83. Given: 

10. interface A { void x(); } 

11. class B implements A { public void x() {} public void y() {} } 

12. class C extends B { public void x() {} } And: 

20. java.util.List<A> list = new java.util.ArrayList<A>(); 

21. list.add(new B()); 

22. list.add(new C()); 

23. for (A a : list) { 

24. a.x(); 

25. a.y(); 

26. } 

What is the result? 

A. The code runs with no output. 

B. An exception is thrown at runtime. 

C. Compilation fails because of an error in line 20. 

D. Compilation fails because of an error in line 21. 

E. Compilation fails because of an error in line 23. 

F. Compilation fails because of an error in line 25. 

Answer: F 


Q84. Given: 

11. static void test() throws RuntimeException { 

12. try { 

13. System.out.print("test "); 

14. throw new RuntimeException(); 

15. } 

16. catch (Exception ex) { System.out.print("exception "); } 

17. } 

18. public static void main(String[] args) { 

19. try { test(); } 

20. catch (RuntimeException ex) { System.out.print("runtime "); } 

21. System.out.print("end "); 

22. } 

What is the result? 

A. test end 

B. Compilation fails. 

C. test runtime end 

D. test exception end 

E. A Throwable is thrown by main at runtime. 

Answer: D 


Q85. Given: 

1. class ClassA { 

2. public int numberOfInstances; 

3. protected ClassA(int numberOfInstances) { 

4. this.numberOfInstances = numberOfInstances; 

5. } 

6. } 

7. public class ExtendedA extends ClassA { 

8. private ExtendedA(int numberOfInstances) { 

9. super(numberOfInstances); 

10. } 

11. public static void main(String[] args) { 

12. ExtendedA ext = new ExtendedA(420); 

13. System.out.print(ext.numberOfInstances); 

14. } 

15. } 

Which statement is true? 

A. 420 is the output. 

B. An exception is thrown at runtime. 

C. All constructors must be declared public. 

D. Constructors CANNOT use the private modifier. 

E. Constructors CANNOT use the protected modifier. 

Answer: A 


310-065  simulations

Renovate 310-065 exam question:

Q86. Given: 

11. public static void test(String str) { 

12. int check = 4; 

13. if (check = str.length()) { 

14. System.out.print(str.charAt(check -= 1) +", "); 

15. } else { 

16. System.out.print(str.charAt(0) + ", "); 

17. } 

18. } and the invocation: 

21. test("four"); 

22. test("tee"); 

23. test("to"); What is the result? 

A. r, t, t, 

B. r, e, o, 

C. Compilation fails. 

D. An exception is thrown at runtime. 

Answer: C 


Q87. Given: 

11. public static void main(String[] args) { 

12. Object obj = new int[] { 1, 2, 3 }; 

13. int[] someArray = (int[])obj; 

14. for (int i : someArray) System.out.print(i + " "); 

15. } 

What is the result? 

A. 1 2 3 

B. Compilation fails because of an error in line 12. 

C. Compilation fails because of an error in line 13. 

D. Compilation fails because of an error in line 14. 

E. A ClassCastException is thrown at runtime. 

Answer: A 


Q88. Given: 

11. class Alpha { 

12. public void foo() { System.out.print("Afoo "); } 

13. } 

14. public class Beta extends Alpha { 

15. public void foo() { System.out.print("Bfoo "); } 

16. public static void main(String[] args) { 

17. Alpha a = new Beta(); 

18. Beta b = (Beta)a; 

19. a.foo(); 

20. b.foo(); 

21. } 

22. } 

What is the result? 

A. Afoo Afoo 

B. Afoo Bfoo 

C. Bfoo Afoo 

D. Bfoo Bfoo 

E. Compilation fails. 

F. An exception is thrown at runtime. 

Answer: D 


Q89. Given that t1 is a reference to a live thread, which is true? 

A. The Thread.sleep() method can take t1 as an argument. 

B. The Object.notify() method can take t1 as an argument. 

C. The Thread.yield() method can take t1 as an argument. 

D. The Thread.setPriority() method can take t1 as an argument. 

E. The Object.notify() method arbitrarily chooses which thread to notify. 

Answer: E 


Q90. Given: 

1. public class Score implements Comparable<Score> { 

2. private int wins, losses; 

3. public Score(int w, int l) { wins = w; losses = l; } 

4. public int getWins() { return wins; } 

5. public int getLosses() { return losses; } 

6. public String toString() { 

7. return "<" + wins + "," + losses + ">"; 

8. } 

9. // insert code here 

10. } 

Which method will complete this class? 

A. public int compareTo(Object o){/*more code here*/} 

B. public int compareTo(Score other){/*more code here*/} 

C. public int compare(Score s1,Score s2){/*more code here*/} 

D. public int compare(Object o1,Object o2){/*more code here*/} 

Answer: B 



see more Sun Certified Programmer for the Java 2 Platform.SE 6.0