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 2 of 13.

  1. Question 11: For which three objects must a vendor provide implementations in its JDBC driver?
  2. Question 12: Given the code fragment: List<Integer> codes = Arrays.asList (10, 20); UnaryOperator<Double> uo = s -> s +10.0; codes.replaceAll(uo); codes.forEach(c -> System…
  3. Question 13: Given: public class Customer { private String fName; private String lName; private static int count; public customer (String first, String last) {fName = first…
  4. Question 14: Given: class Worker extends Thread { CyclicBarrier cb; public Worker(CyclicBarrier cb) { this.cb = cb; } public void run () { try { cb.await(); System.out.prin…
  5. Question 15: Given the code fragment: String str = "Java is a programming language"; ToIntFunction<String> indexVal = str: : indexOf; //line n1 int x = indexVal.applyAsInt(…
  6. Question 16: Given the code fragment: List<String> codes = Arrays.asList ("DOC", "MPEG", "JPEG"); codes.forEach (c -> System.out.print(c + " ")); String fmt = codes.stream(…
  7. Question 17: Given the code fragment: List<String> nL = Arrays.asList("Jim", "John", "Jeff"); Function<String, String> funVal = s -> "Hello : ".contact(s); nL.Stream() .map…
  8. Question 18: Which two code blocks correctly initialize a Locale variable?
  9. Question 19: Given: class FuelNotAvailException extends Exception { } class Vehicle { void ride() throws FuelNotAvailException { //line n1 System.out.println("Happy Journey…
  10. Question 20: Given the definition of the Emp class: public class Emp private String eName; private Integer eAge; Emp(String eN, Integer eA) { this.eName = eN; this.eAge = e…