We offer the latest 1Z0-809 practice test designed for free and effective online Java SE 8 Programmer II certification preparation. It's a simulation of the real 1Z0-809 exam experience, built to help you understand the structure, complexity, and topics you'll face on exam day.
Given code of Test.java file: 1. package com.udayan.ocp;2. 3. import java.util.*;4. 5. public class Test {6. public static void main(String[] args) {7. NavigableMap map = new TreeMap();8. map.put(25, "Pune");9. map.put(32, "Mumbai");10. map.put(11, "Sri Nagar");11. map.put(39, "Chennai");12. 13. System.out.println(map.headMap(25, true));14. }15. }
Consider the code of Test.java file:1. package com.udayan.ocp;2. 3. class Player {4. String name;5. int age;6. 7. Player() {8. this.name = "Yuvraj";9. this.age = 36;10. }11. 12. public String toString() {13. return name + ", " + age;14. }15. 16. public Class getClass() { 17. return super.getClass();18. }19. }20. 21. public class Test {22. public static void main(String[] args) {23. System.out.println(new Player());24. }25. }What will be the result of compiling and executing Test class?
Given the code fragment:Stream
Given code of Test.java file: 1. package com.udayan.ocp;2. 3. public class Test {4. private static void div(int i, int j) {5. try {6. System.out.println(i / j);7. } catch(ArithmeticException e) {8. throw (RuntimeException)e;9. }10. }11. public static void main(String[] args) {12. try {13. div(5, 0);14. } catch(ArithmeticException e) {15. System.out.println("AE");16. } catch(RuntimeException e) {17. System.out.println("RE");18. }19. }20. }What will be the result of compiling and executing Test class?
The last statement inside main(String []) method, increments value of i, which means it is not effectively final and hence compilation error.//Test.javapackage com.udayan.ocp; class Player { String name; int age; Player() { this.name = "Virat"; this.age = 29; } public int hashCode() { return 100; }} public class Test { public static void main(String[] args) { System.out.println(new Player()); }}Hexadecimal representation of 100 is 64.Which of the following option is correct?
© Copyrights FreePDFQuestions 2025. All Rights Reserved
We use cookies to ensure that we give you the best experience on our website (FreePDFQuestions). If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the FreePDFQuestions.