Top 10 braindumps 310-065 for IT learners (61 to 70)

Act now and download your SUN 310-065 test today! Do not waste time for the worthless SUN 310-065 tutorials. Download Renewal SUN Sun Certified Programmer for the Java 2 Platform.SE 6.0 exam with real questions and answers and begin to learn SUN 310-065 with a classic professional.

2016 Jun 310-065 Study Guide Questions:

Q61. Given: 

1. public class Donkey { 

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

3. boolean assertsOn = false; 

4. assert (assertsOn) : assertsOn = true; 

5. if(assertsOn) { 

6. System.out.println("assert is on"); 

7. } 

8. } 

9. } 

If class Donkey is invoked twice, the first time without assertions enabled, and the second time with assertions enabled, what are the results? 

A. no output 

B. no output 

assert is on 

C. assert is on 

D. no output 

An AssertionError is thrown. 

E. assert is on 

An AssertionError is thrown. 

Answer: D 

Q62. Given: 

31. // some code here 

32. try { 

33. // some code here 

34. } catch (SomeException se) { 

35. // some code here 

36. } finally { 

37. // some code here 

38. } 

Under which three circumstances will the code on line 37 be executed? (Choose three.) 

A. The instance gets garbage collected. 

B. The code on line 33 throws an exception. 

C. The code on line 35 throws an exception. 

D. The code on line 31 throws an exception. 

E. The code on line 33 executes successfully. 

Answer: BCE 

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

310-065  torrent

Renewal 310-065 exam price:

Q64. Given: 

11. class ClassA {} 

12. class ClassB extends ClassA {} 

13. class ClassC extends ClassA {} and: 

21. ClassA p0 = new ClassA(); 

22. ClassB p1 = new ClassB(); 

23. ClassC p2 = new ClassC(); 

24. ClassA p3 = new ClassB(); 

25. ClassA p4 = new ClassC(); 

Which three are valid? (Choose three.) 

A. p0 = p1; 

B. p1 = p2; 

C. p2 = p4; 

D. p2 = (ClassC)p1; 

E. p1 = (ClassB)p3; 

F. p2 = (ClassC)p4; 

Answer: AEF 

Q65. Given: 

1. public class A { 

2. public void doit() { 

3. } 

4. public String doit() { 

5. return "a"; 

6. } 

7. public double doit(int x) { 

8. return 1.0; 

9. } 

10. } 

What is the result? 

A. An exception is thrown at runtime. 

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

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

D. Compilation succeeds and no runtime errors with class A occur. 

Answer: C 

Q66. Which Man class properly represents the relationship "Man has a best friend who is a Dog"? 

A. class Man extends Dog { } 

B. class Man implements Dog { } 

C. class Man { private BestFriend dog; } 

D. class Man { private Dog bestFriend; } 

E. class Man { private Dog<bestFriend>; } 

F. class Man { private BestFriend<dog>; } 

Answer: D 

certleader.com

High value 310-065 testing engine:

Q67. Given: 

11. public void testIfA() { 

12. if (testIfB("True")) { 

13. System.out.println("True"); 

14. } else { 

15. System.out.println("Not true"); 

16. } 

17. } 

18. public Boolean testIfB(String str) { 

19. return Boolean.valueOf(str); 

20. } 

What is the result when method testIfA is invoked? 

A. True 

B. Not true 

C. An exception is thrown at runtime. 

D. Compilation fails because of an error at line 12. 

E. Compilation fails because of an error at line 19. 

Answer: A 

Q68. A programmer must create a generic class MinMax and the type parameter of MinMax must implement Comparable. Which implementation of MinMax will compile? 

A. class MinMax<E extends Comparable<E>> { 

E min = null; 

E max = null; 

public MinMax() {} 

public void put(E value) { /* store min or max */ } 

B. class MinMax<E implements Comparable<E>> { 

E min = null; 

E max = null; 

public MinMax() {} 

public void put(E value) { /* store min or max */ } 

C. class MinMax<E extends Comparable<E>> { 

<E>

 E min = null; 

<E>

 E max = null; 

public MinMax() {} 

public <E> void put(E value) { /* store min or max */ } 

D. class MinMax<E implements Comparable<E>> { 

<E>

 E min = null; 

<E>

 E max = null; public MinMax() {} public <E> void put(E value) { /* store min or max */ } 

Answer: A 

Q69. Given: 

12. String csv = "Sue,5,true,3"; 

13. Scanner scanner = new Scanner( csv ); 

14. scanner.useDelimiter(","); 

15. int age = scanner.nextInt(); What is the result? 

A. Compilation fails. 

B. After line 15, the value of age is 5. 

C. After line 15, the value of age is 3. 

D. An exception is thrown at runtime. 

Answer: D 

Q70. Given: 

1. import java.util.*; 

2. public class WrappedString { 

3. private String s; 

4. public WrappedString(String s) { this.s = s; } 

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

6. HashSet<Object> hs = new HashSet<Object>(); 

7. WrappedString ws1 = new WrappedString("aardvark"); 

8. WrappedString ws2 = new WrappedString("aardvark"); 

9. String s1 = new String("aardvark"); 

10. String s2 = new String("aardvark"); 

11. hs.add(ws1); hs.add(ws2); hs.add(s1); hs.add(s2); 

12. System.out.println(hs.size()); } } What is the result? 

A. 0 

B. 1 

C. 2 

D. 3 

E. 4 

F. Compilation fails. 

G. An exception is thrown at runtime. 

Answer: D 

About 310-065 Information: 310-065 Dumps

Certleader Dumps
Certleader is a company specialized on providing high quality IT exam materials and fully committed to assist our respected clients crack any IT certification tests on their 1st efforts.