310-065 bible(1 to 10) for IT professionals: Jun 2016 Edition

Top Quality of 310-065 practice test materials and questions for SUN certification for IT professionals, Real Success Guaranteed with Updated 310-065 pdf dumps vce Materials. 100% PASS Sun Certified Programmer for the Java 2 Platform.SE 6.0 exam Today!

2016 Jun 310-065 Study Guide Questions:

Q1. Given that the current directory is empty, and that the user has read and write permissions, and the following: 

11. import java.io.*; 

12. public class DOS { 

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

14. File dir = new File("dir"); 

15. dir.mkdir(); 

16. File f1 = new File(dir, "f1.txt"); 

17. try { 

18. f1.createNewFile(); 

19. } catch (IOException e) { ; } 

20. File newDir = new File("newDir"); 

21. dir.renameTo(newDir); 

22. } 

23. } 

Which statement is true? 

A. Compilation fails. 

B. The file system has a new empty directory named dir. 

C. The file system has a new empty directory named newDir. 

D. The file system has a directory named dir, containing a file f1.txt. 

E. The file system has a directory named newDir, containing a file f1.txt. 

Answer: E 

Q2. Given: 

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

12. Integer i = new Integer(1) + new Integer(2); 

13. switch(i) { 

14. case 3: System.out.println("three"); break; 

15. default: System.out.println("other"); break; 

16. } 

17. } 

What is the result? 

A. three 

B. other 

C. An exception is thrown at runtime. 

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

E. Compilation fails because of an error on line 13. 

F. Compilation fails because of an error on line 15. 

Answer: A 

Q3. Given: 

1. package geometry; 

2. public class Hypotenuse { 

3. public InnerTriangle it = new InnerTriangle(); 

4. class InnerTriangle { 

5. public int base; 

6. public int height; 

7. } 

8. } 

Which statement is true about the class of an object that can reference the variable base? 

A. It can be any class. 

B. No class has access to base. 

C. The class must belong to the geometry package. 

D. The class must be a subclass of the class Hypotenuse. 

Answer: C 

310-065  question

Most recent 310-065 test:

Q4. Given: 

10. class One { 

11. public One foo() { return this; } 

12. } 

13. class Two extends One { 

14. public One foo() { return this; } 

15. } 

16. class Three extends Two { 

17. // insert method here 

18. } 

Which two methods, inserted individually, correctly complete the Three class? (Choose two.) 

A. public void foo() {} 

B. public int foo() { return 3; } 

C. public Two foo() { return this; } 

D. public One foo() { return this; } 

E. public Object foo() { return this; } 

Answer: CD 

Q5. Click the Exhibit button. 

Given: 

25. try { 

26. A a = new A(); 

27. a.method1(); 

28. } catch (Exception e) { 

29. System.out.print("an error occurred"); 

30. } 

Which two statements are true if a NullPointerException is thrown on line 3 of class C? (Choose two.) 

A. The application will crash. 

B. The code on line 29 will be executed. 

C. The code on line 5 of class A will execute. 

D. The code on line 5 of class B will execute. 

E. The exception will be propagated back to line 27. 

Answer: BE 

Q6. Given: 

5. class Payload { 

6. private int weight; 

7. public Payload (int w) { weight = w; } 

8. public void setWeight(int w) { weight = w; } 

9. public String toString() { return Integer.toString(weight); } 

10. } 

11. public class TestPayload { 

12. static void changePayload(Payload p) { /* insert code */ } 

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

14. Payload p = new Payload(200); 

15. p.setWeight(1024); 

16. changePayload(p); 

17. System.out.println("p is " + p); 

18. } } 

Which code fragment, inserted at the end of line 12, produces the output p is 420? 

A. p.setWeight(420); 

B. p.changePayload(420); 

C. p = new Payload(420); 

D. Payload.setWeight(420); 

E. p = Payload.setWeight(420); 

Answer: A 

certleader.com

Breathing 310-065 bootcamp:

Q7. Given: 

1. public class Breaker2 { 

2. static String o = ""; 

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

4. z: 

5. for(int x = 2; x < 7; x++) { 

6. if(x==3) continue; 

7. if(x==5) break z; 

8. o = o + x; 

9. } 

10. System.out.println(o); 

11. } 

12. } 

What is the result? 

A. 2 

B. 24 

C. 234 

D. 246 

E. 2346 

F. Compilation fails. 

Answer: B 

Q8. Given that the elements of a PriorityQueue are ordered according to natural ordering, and: 

2. import java.util.*; 

3. public class GetInLine { 

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

5. PriorityQueue<String> pq = new PriorityQueue<String>(); 

6. pq.add("banana"); 

7. pq.add("pear"); 

8. pq.add("apple"); 

9. System.out.println(pq.poll() + " " + pq.peek()); 

10. } 

11. } 

What is the result? 

A. apple pear 

B. banana pear 

C. apple apple 

D. apple banana 

E. banana banana 

Answer: D 

Q9. Which two code fragments correctly create and initialize a static array of int elements? 

(Choose two.) 

A. static final int[] a = { 100,200 }; 

B. static final int[] a; 

static { a=new int[2]; a[0]=100; a[1]=200; } 

C. static final int[] a = new int[2]{ 100,200 }; 

D. static final int[] a; 

static void init() { a = new int[3]; a[0]=100; a[1]=200; } 

Answer: AB 

Q10. Given: 

11. static void test() { 

12. try { 

13. String x = null; 

14. System.out.print(x.toString() + " "); 

15. } 

16. finally { System.out.print("finally "); } 

17. } 

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

19. try { test(); } 

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

21. } 

What is the result? 

A. null 

B. finally 

C. null finally 

D. Compilation fails. 

E. finally exception 

Answer: E 

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.