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

  1. Question 142: Given: public interface Moveable<Integer> { public default void walk (Integer distance) {System.out.println("Walking");) public void run(Integer distance); } W…
  2. Question 145: Given: class Book { int id; String name; public Book (int id, String name) { this.id = id; this.name = name; } public boolean equals (Object obj) { //line n1 b…
  3. Question 146: Which statement is true about the single abstract method of the java.util.function.Function interface?
  4. Question 147: 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 148: Given the code fragment: LocalDate valentinesDay =LocalDate.of(2015, Month.FEBRUARY, 14); LocalDate nextYear = valentinesDay.plusYears(1); nextYear.plusDays(15…
  6. Question 149: Given the code fragment: 9. Connection conn = DriveManager.getConnection(dbURL, userName, passWord); 10. String query = "SELECT id FROM Employee"; 11. try (Sta…
  7. Question 153: Given: Item table - "¢ ID, INTEGER: PK "¢ DESCRIP, VARCHAR(100) "¢ PRICE, REAL "¢ QUANTITY< INTEGER And given the code fragment: 9. try { 10. Connection conn =…
  8. Question 156: Given: public class Canvas implements Drawable { public void draw () { } } public abstract class Board extends Canvas { } public class Paper extends Canvas { p…
  9. Question 157: Given: public class Counter { public static void main (String[ ] args) { int a = 10; int b = -1; assert (b >=1) : "Invalid Denominator"; int Ñ = a / b; System.…
  10. Question 158: Given the code fragment: List<Integer> nums = Arrays.asList (10, 20, 8): System.out.println ( //line n1 ); Which code fragment must be inserted at line n1 to e…