Java SE 8 Programmer II Free Practice Exam Questions

122 real Java SE 8 Programmer II exam questions with answers and AI explanations. Oracle certification prep — page 5 of 13.

  1. Question 41: Given the code fragment: Path path1 = Paths.get("/app/./sys/"); Path res1 = path1.resolve("log"); Path path2 = Paths.get("/server/exe/"); Path res1 = path1.res…
  2. Question 42: Given the code fragment: List<String> colors = Arrays.asList("red", "green", "yellow"); Predicate<String> test = n - > { System.out.println("Searching"¦"); ret…
  3. Question 43: Given: class UserException extends Exception { } class AgeOutOfLimitException extends UserException { } and the code fragment: class App { public void doRegist…
  4. Question 44: DriverManager class? Which statement is true about the Connection.
  5. Question 45: You have been asked to create a ResourceBundle which uses a properties file to localize an application. Which code example specifies valid keys of menu1 and me…
  6. Question 46: /green.txt and /colors/yellow.txt are accessible, and the code fragment: Given that - Path source = Paths.get("/green.txt); Path target = Paths.get("/colors/ye…
  7. Question 47: Given: IntStream stream = IntStream.of (1,2,3); IntFunction<Integer> inFu= x -> y -> x*y; //line n1 IntStream newStream = stream.map(inFu.apply(10)); //line n2…
  8. Question 48: Given: 1. abstract class Shape { 2. Shape ( ) { System.out.println ("Shape"); } 3. protected void area ( ) { System.out.println ("Shape"); } 4. } 5. 6. class S…
  9. Question 49: Which two statements are true about localizing an application? (Choose two.)
  10. Question 52: Which statement is true about java.util.stream.Stream?