Exam Details

  • Exam Code
    :1Z0-809
  • Exam Name
    :Java SE 8 Programmer II
  • Certification
    :Oracle Database
  • Vendor
    :Oracle
  • Total Questions
    :207 Q&As
  • Last Updated
    :May 13, 2024

Oracle Oracle Database 1Z0-809 Questions & Answers

  • Question 31:

    Given:

    public class Canvas implements Drawable {

    public void draw () { }

    }

    public abstract class Board extends Canvas { }

    public class Paper extends Canvas {

    protected void draw (int color) { }

    }

    public class Frame extends Canvas implements Drawable {

    public void resize () { }

    abstract void open ();

    }

    public interface Drawable {

    public abstract void draw ();

    }

    Which statement is true?

    A. Board does not compile.

    B. Paper does not compile.

    C. Frame does not compile.

    D. Drawable does not compile.

    E. All classes compile successfully.

  • Question 32:

    Given the code fragment:

    UnaryOperator uo1 = s -> s*2; //line n1

    List loanValues = Arrays.asList(1000.0, 2000.0);

    loanValues.stream()

    .filter(lv -> lv >= 1500)

    .map(lv -> uo1.apply(lv)) //line n2

    .forEach(s -> System.out.print(s + " "));

    What is the result?

    A. 4000.0

    B. 4000

    C. A compilation error occurs at line n1.

    D. A compilation error occurs at line n2.

  • Question 33:

    Given the definition of the Employee class: and this code fragment:

    What is the result?

    A. [sales:Ada, hr:Bob, sales:Bob, hr:Eva]

    B. [Ada:sales, Bob:sales, Bob:hr, Eva:hr]

    C. [hr:Eva, hr:Bob, sales:Bob, sales:Ada]

    D. [hr:Bob, hr:Eva, sales:Ada, sales:Bob]

  • Question 34:

    Given the code fragments:

    class ThreadRunner implements Runnable {

    public void run () { System.out.print ("Runnable") ; }

    }

    class ThreadCaller implements Callable {

    Public String call () throws Exception {return "Callable"; )

    }

    and

    ExecutorService es = Executors.newCachedThreadPool ();

    Runnable r1 = new ThreadRunner ();

    Callable c1 = new ThreadCaller ();

    // line n1

    es.shutdown();

    Which code fragment can be inserted at line n1 to start r1 and c1 threads?

    A. Future f1 = (Future) es.submit (r1); es.execute (c1);

    B. es.execute (r1); Future f1 = es.execute (c1) ;

    C. Future f1 = (Future) es.execute(r1); Future f2 = (Future) es.execute(c1);

    D. es.submit(r1); Future f1 = es.submit (c1);

  • Question 35:

    Given the code fragment:

    List doubles = Arrays.asList (100.12, 200.32);

    DoubleFunction funD = d ?gt; d + 100.0;

    doubles.stream (). forEach (funD); // line n1

    doubles.stream(). forEach(e ?gt; System.out.println(e)); // line n2

    What is the result?

    A. A compilation error occurs at line n2.

    B. 200.12

    300.32

    C. 100.12

    200.32

    D. A compilation error occurs at line n1.

  • Question 36:

    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?

    A. 4:60

    B. 2:30

    C. 4:60

    2:30

    3:20

    1:10

    D. 4:0

    E. The program prints nothing

  • Question 37:

    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(scr));

    What is the result?

    A. A compilation error occurs.

    B. Java EE Java ME

    C. [Java EE: Helen:Houston] [Java ME: Jessy:Chicago, Java ME: Mark:Chicago]

    D. [Java ME: Jessy:Chicago, Java ME: Mark:Chicago] [Java EE: Helen:Houston]

  • Question 38:

    Given:

    What change should you make to guarantee a single order of execution (printed values 1 -100 in order)?

    A. Line 3: public synchronized void run() {

    B. Line 1: class MyClass extends Thread {

    C. Line 2: public volatile int value;

    D. Line 2: public synchronized int value;

  • Question 39:

    Given: and the code fragment:

    The threads t1 and t2 execute asynchronously and possibly prints ABCA or AACB.

    You have been asked to modify the code to make the threads execute synchronously and prints ABC.

    Which modification meets the requirement?

    A. start the threads t1 and t2 within a synchronized block.

    B. Replace line n1 with: private synchronized int count = 0;

    C. Replace line n2 with: public synchronized void run () {

    D. Replace line n2 with: volatile int count = 0;

  • Question 40:

    Given that these files exist and are accessible:

    /sports/info.txt

    /sports/cricket/players.txt

    /sports/cricket/data/ODI.txt

    and given the code fragment:

    int maxDepth =2;

    Stream paths = Files.find(Paths.get("/sports"),

    maxDepth,

    (p, a) -> p.getFileName().toString().endsWith ("txt"),

    FileVisitOption.FOLLOW_LINKS);

    Long fCount = paths.count();

    System.out.println(fCount);

    Assuming that there are NO soft-link/symbolic links to any of the files in the directory structure, what is the

    result?

    A. 1

    B. 2

    C. 3

    D. An Exception is thrown at runtime.

Tips on How to Prepare for the Exams

Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Oracle exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your 1Z0-809 exam preparations and Oracle certification application, do not hesitate to visit our Vcedump.com to find your solutions here.