Given code of Test.java file: 1. package com.udayan.ocp;2. 3. import java.util.Arrays;4. import java.util.List;5. import java.util.ListIterator;6. 7. public class Test {8. public static void main(String[] args) {9. List list = Arrays.asList("T", "S", "R", "I", "F");10. ListIterator iter = list.listIterator(2);11. while(iter.hasNext()) {12. System.out.print(iter.next());13. }14. }15. }What will be the result of compiling and executing Test class?
Given the code fragment:List
Given the code fragment:Path p1 = Paths.get(“/Pics/MyPic.jpeg”);System.out.println (p1.getNameCount() + “:” + p1.getName(1) + “:” + p1.getFileName());Assume that the Pics directory does NOT exist.What is the result?
Given the code fragment:Stream
Given code of Test.java file: 1. package com.udayan.ocp;2. 3. import java.util.stream.Stream;4. 5. public class Test {6. public static void main(String[] args) {7. System.out.println(Stream.of(10, 0, -10).sorted().findAny().orElse(-1));8. }9. }Which of the following statements are true about the execution of Test class?Select 2 options.
© Copyrights FreePDFQuestions 2026. 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.