ORACLE certification preparation

1Z0-809 Practice Questions

Practice exam-style questions, check your answers, and review explanations and source references where they are available.

Exam
1Z0-809
Provider
ORACLE
Full set
196 questions
Last Update Check
Given the code fragment: Oracle 1Z0-809 question What is the result?
Answer options
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; } 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(scr)); What is the result?
Answer options
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?
Answer options
Given the code fragment: Path file = Paths.get (“courses.txt”); // line n1 Assume the courses.txt is accessible. Which code fragment can be inserted at line n1 to enable the code to print the content of the courses.txt file?
Answer options
Given that /green.txt and /colors/yellow.txt are accessible, and the code fragment: Path source = Paths.get(“/green.txt); Path target = Paths.get(“/colors/yellow.txt); Files.move(source, target, StandardCopyOption.ATOMIC_MOVE); Files.delete(source); Which statement is true?
Answer options

Given the code fragment:

List<String> empDetails = Arrays.asList(“100, Robin, HR”,

“200, Mary, AdminServices”,

“101, Peter, HR”);

empDetails.stream()

.filter(s-> s.contains(“1”))

.sorted()

.forEach(System.out::println); //line n1

What is the result?

Answer options
Given the code fragment: List str = Arrays.asList (“my”, “pen”, “is”, “your’, “pen”); Predicate test = s -> { int i = 0; boolean result = s.contains (“pen”); System.out.print(i++) + “:”); return result; }; str.stream() .filter(test) .findFirst() .ifPresent(System.out ::print); What is the result?
Answer options
Which two reasons should you use interfaces instead of abstract classes? (Choose two.)
Answer options
Given: public interface Moveable { public default void walk (Integer distance) {System.out.println(“Walking”);) public void run(Integer distance); } Which statement is true?
Answer options
Given the code fragment: Oracle 1Z0-809 question What is the result?
Answer options
Question 1 of 10

Source context

How this practice set is maintained

Maintained by the CertMage content team, this page loads questions from the exam dataset connected to its preparation resource. When an answer includes a supporting reference, it is shown with that answer so you can review the underlying vendor documentation.

Certification objectives, interfaces, and vendor services can change. Verify important details against the provider's current exam guide and documentation before your exam.

Scroll to Top