Free 1Z0-809 Practice Test Questions and Answers (2026) | Cert Empire Practice Questions

Free preview: 20 questions.

Already purchased? Log in

Oracle 1Z0-809

View Mode
Q: 1
Given the code fragments : Oracle 1Z0-809 question and Oracle 1Z0-809 question What is the result?
Options
Q: 2
Given: public enum USCurrency { PENNY (1), NICKLE(5), DIME (10), QUARTER(25); private int value; public USCurrency(int value) { this.value = value; } public int getValue() {return value;} } public class Coin { public static void main (String[] args) { USCurrency usCoin =new USCurrency.DIME; System.out.println(usCoin.getValue()): } } Which two modifications enable the given code to compile? (Choose two.)
Options
Q: 3
Given: public class Product { int id; int price; public Product (int id, int price) { this.id = id; this.price = price; } Public String toString () { return id + “:” + price;) } and the code fragment: List products = new ArrayList (Arrays.asList(new Product(1, 10), new Product (2, 30), new Product (3, 20)); Product p = products.stream().reduce(new Product (4, 0), (p1, p2) -> { p1.price+=p2.price; return new Product (p1.id, p1.price);}); products.add(p); products.stream().parallel() .reduce((p1, p2) - > p1.price > p2.price ? p1 : p2) .ifPresent(System.out: :println); What is the result?
Options
Q: 4
Given the code fragment: List nL = Arrays.asList(“Jim”, “John”, “Jeff”); Function funVal = s -> “Hello : “.contact(s); nL.Stream() .map(funVal) .peek(System.out::print); What is the result?
Options
Q: 5
Given: 1. abstract class Shape { 2. Shape ( ) { System.out.println (“Shape”); } 3. protected void area ( ) { System.out.println (“Shape”); } 4. } 5. 6. class Square extends Shape { 7. int side; 8. Square int side { 9./* insert code here */ 10. this.side = side; 11. } 12. public void area ( ) { System.out.println (“Square”); } 13. } 14. class Rectangle extends Square { 15. int len, br; 16. Rectangle (int x, int y) { 17. /* insert code here */ 18. len = x, br = y; 19. } 20. void area ( ) { System.out.println (“Rectangle”); } 21. } Which two modifications enable the code to compile? (Choose two.)
Options
Q: 6

For which three objects must a vendor provide implementations in its JDBC driver? (Choose three.)

Options
Q: 7
Given the code fragment: List listVal = Arrays.asList(“Joe”, “Paul”, “Alice”, “Tom”); System.out.println ( // line n1 ); Which code fragment, when inserted at line n1, enables the code to print the count of string elements whose length is greater than three?
Options
Q: 8
Given: class CheckClass { public static int checkValue (String s1, String s2) { return s1 length() – s2.length(); } } and the code fragment: String[] strArray = new String [] {“Tiger”, “Rat”, “Cat”, “Lion”} //line n1 for (String s : strArray) { System.out.print (s + “ “); } Which code fragment should be inserted at line n1 to enable the code to print Rat Cat Lion Tiger?
Options
Q: 9
Given that data.txt and alldata.txt are accessible, and the code fragment: Oracle 1Z0-809 question What is required at line n1 to enable the code to overwrite alldata.txt with data.txt?
Options
Q: 10
Given: class Vehicle { int vno; String name; public Vehicle (int vno, String name) { this.vno = vno,; this.name = name; } public String toString () { return vno + “:” + name; } } and this code fragment: Set vehicles = new TreeSet (); vehicles.add(new Vehicle (10123, “Ford”)); vehicles.add(new Vehicle (10124, “BMW”)); System.out.println(vehicles); What is the result?
Options
Q: 11

Given the code fragment: List empDetails = Arrays.asList(“100, Robin, HR”, “200, Mary, AdminServices”,“101, Peter, HR”); empDetails.stream() .filter(s-> s.contains(“r”)) .sorted() .forEach(System.out::println); //line n1 What is the result?

Options
Q: 12
Given: class Worker extends Thread { CyclicBarrier cb; public Worker(CyclicBarrier cb) { this.cb = cb; } public void run () { try { cb.await(); System.out.println(“Worker…”); } catch (Exception ex) { } } } class Master implements Runnable { //line n1 public void run () { System.out.println(“Master…”); } } and the code fragment: Master master = new Master(); //line n2 Worker worker = new Worker(cb); worker.start(); You have been asked to ensure that the run methods of both the Worker and Master classes are executed. Which modification meets the requirement?
Options
Q: 13
Given: class Student { String course, name, city; public Student (String name, String course, String city) { this.course = course; this.name = name; this.city = city; } public String toString() { return course + “:” + name + “:” + city; } public String getCourse() {return course;} public String getName() {return name;} public String getCity() {return city;} and the code fragment: List stds = Arrays.asList( new Student (“Jessy”, “Java ME”, “Chicago”), new Student (“Helen”, “Java EE”, “Houston”), new Student (“Mark”, “Java ME”, “Chicago”)); stds.stream() .collect(Collectors.groupingBy(Student::getCourse)) .forEach(src, res) -> System.out.println(res)); What is the result?
Options
Q: 14
Given the code fragment: Oracle 1Z0-809 question What is the result?
Options
Q: 15
Given: Oracle 1Z0-809 question and the code fragment: Oracle 1Z0-809 question What is the result?
Options
Q: 16
Given the code fragment: public class Foo { public static void main (String [ ] args) { Map unsortMap = new HashMap ( ); unsortMap.put (10, “z”); unsortMap.put (5, “b”); unsortMap.put (1, “d”); unsortMap.put (7, “e”); unsortMap.put (50, “j”); Map treeMap = new TreeMap (new Comparator ( ) { @Override public int compare (Integer o1, Integer o2) {return o2.compareTo (o1); } } ); treeMap.putAll (unsortMap); for (Map.Entry entry : treeMap.entrySet () ) { System.out.print (entry.getValue () + “ “); } } } What is the result?
Options
Q: 17
Given the records from the STUDENT table: Oracle 1Z0-809 question Given the code fragment: Oracle 1Z0-809 question Assume that the URL, username, and password are valid. What is the result?
Options
Q: 18
Given the code fragment: List doubles = Arrays.asList (100.12, 200.32); DoubleFunction funD = d –> d + 100.0; doubles.stream (). forEach (funD); // line n1 doubles.stream(). forEach(e –> System.out.println(e)); // line n2 What is the result?
Options
Q: 19
Given: public class product { int id; int price; public Product (int id, int price) { this.id = id; this.price = price; } public String toString() { return id + “:” + price; } } and the code fragment: List products = Arrays.asList(new Product(1, 10), new Product (2, 30), new Product (2, 30)); Product p = products.stream().reduce(new Product (4, 0), (p1, p2) -> { p1.price+=p2.price; return new Product (p1.id, p1.price);}); products.add(p); products.stream().parallel() .reduce((p1, p2) - > p1.price > p2.price ? p1 : p2) .ifPresent(System.out: :println); What is the result?
Options
Q: 20
Given the code fragment: Oracle 1Z0-809 question Which two code fragments, when inserted at line n1 independently, result in the output PEEK: Unix?
Options
Question 1 of 20

Premium Access Includes

  • Quiz Simulator
  • Exam Mode
  • Progress Tracking
  • Question Saving
  • Flash Cards
  • Drag & Drops
  • 3 Months Access
  • PDF Downloads
Get Premium Access
Scroll to Top

FLASH OFFER

Days
Hours
Minutes
Seconds

avail 10% DISCOUNT on YOUR PURCHASE