Handsome Savings - Limited Time Offer 30% OFF - Ends In 0d 0h 0m 0s Coupon code: 50OFF
Welcome to QA4Exam
Logo

- Trusted Worldwide Questions & Answers

Oracle 1Z0-809 Exam Actual Questions

The questions for 1Z0-809 were last updated on Oct 3, 2024.
  • Viewing page 1 out of 39 pages.
  • Viewing questions 1-5 out of 196 questions
Unlock Access to All 196 Questions & Answers
Question No. 1

Given:

From what threading problem does the program suffer?

Show Answer Hide Answer
Correct Answer: B

Question No. 2

Given the definition of the Employee class:

and this code fragment:

What is the result?

Show Answer Hide Answer
Correct Answer: A

Question No. 3

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?

Show Answer Hide Answer
Correct Answer: D

Question No. 4

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?

Show Answer Hide Answer
Correct Answer: A


Question No. 5

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?

Show Answer Hide Answer
Correct Answer: C

Product Image

Unlock All Questions for Oracle 1Z0-809 Exam

Full Exam Access, Actual Exam Questions, Validated Answers, Anytime Anywhere, No Download Limits, No Practice Limits

Get All 196 Questions & Answers