Exam2pass
0 items Sign In or Register
  • Home
  • IT Exams
  • Guarantee
  • FAQs
  • Reviews
  • Contact Us
  • Demo
Exam2pass > Oracle > Oracle Certifications > 1Z0-809 > 1Z0-809 Online Practice Questions and Answers

1Z0-809 Online Practice Questions and Answers

Questions 4

Given:

class Sum extends RecursiveAction { //line n1

static final int THRESHOLD_SIZE = 3;

int stIndex, lstIndex;

int [ ] data;

public Sum (int [ ]data, int start, int end) {

this.data = data;

this stIndex = start;

this. lstIndex = end;

}

protected void compute ( ) {

int sum = 0;

if (lstIndex ?stIndex<;= THRESHOLD_SIZE) {

for (int i = stIndex; i < lstIndex; i++) {

sum += data [i];

}

System.out.println(sum);

} else {

new Sum (data, stIndex + THRESHOLD_SIZE, lstIndex).fork( );

new Sum (data, stIndex,

Math.min (lstIndex, stIndex + THRESHOLD_SIZE)

).compute ();

}

}

}

and the code fragment:

ForkJoinPool fjPool = new ForkJoinPool ( );

int data [ ] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

fjPool.invoke (new Sum (data, 0, data.length));

and given that the sum of all integers from 1 to 10 is 55.

Which statement is true?

A. The program prints several values that total 55.

B. The program prints 55.

C. A compilation error occurs at line n1.

D. The program prints several values whose sum exceeds 55.

Buy Now

Correct Answer: C

Questions 5

The data.doc, data.txt and data.xml files are accessible and contain text.

Given the code fragment:

Stream paths = Stream.of (Paths. get("data.doc"),

Paths. get("data.txt"),

Paths. get("data.xml"));

paths.filter(s-> s.toString().endWith("txt")).forEach(

s -> {

try {

Files.readAllLines(s)

.stream()

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

} catch (IOException e) {

System.out.println("Exception");

}

}

);

What is the result?

A. The program prints the content of data.txt file.

B. The program prints: Exception <> Exception

C. A compilation error occurs at line n1.

D. The program prints the content of the three files.

Buy Now

Correct Answer: A

Questions 6

Which two code blocks correctly initialize a Locale variable? (Choose two.)

A. Locale loc1 = "UK";

B. Locale loc2 = Locale.getInstance("ru");

C. Locale loc3 = Locale.getLocaleFactory("RU");

D. Locale loc4 = Locale.UK;

E. Locale loc5 = new Locale ("ru", "RU");

Buy Now

Correct Answer: DE

Questions 7

Given the code fragment:

public class FileThread implements Runnable { String fName;

public FileThread(String fName) { this.fName = fName; }

public void run () System.out.println(fName);}

public static void main (String[] args) throws IOException, InterruptedException {

ExecutorService executor = Executors.newCachedThreadPool();

Stream listOfFiles = Files.walk(Paths.get("Java Projects"));

listOfFiles.forEach(line -> {

executor.execute(new FileThread(line.getFileName().toString())); //

line n1

});

executor.shutdown();

executor.awaitTermination(5, TimeUnit.DAYS); //

line n2

}

}

The Java Projects directory exists and contains a list of files.

What is the result?

A. The program throws a runtime exception at line n2.

B. The program prints files names concurrently.

C. The program prints files names sequentially.

D. A compilation error occurs at line n1.

Buy Now

Correct Answer: B

Questions 8

Given the code fragment:

ZonedDateTime depart = ZonedDateTime.of(2015, 1, 15, 3, 0, 0, 0, ZoneID.of("UTC-7")); ZonedDateTime arrive = ZonedDateTime.of(2015, 1, 15, 9, 0, 0, 0, ZoneID.of("UTC-5")); long hrs = ChronoUnit.HOURS.between(depart, arrive); //line n1 System.out.println("Travel time is" + hrs + "hours");

What is the result?

A. Travel time is 4 hours

B. Travel time is 6 hours

C. Travel time is 8 hours

D. An exception is thrown at line n1.

Buy Now

Correct Answer: A

Questions 9

Given: and the code fragment:

Which modification enables the code fragment to print Speaker?

A. Implement Predicate in the Product.ProductFilter class and replace line n2 with .filter (p -> p.ProductFilter.test (p))

B. Replace line n1 with: public static boolean isAvailable (Product p) {

C. Replace line n2 with: .filter (p -> p.ProductFilter: :isAvailable (p))

D. Replace line n2 with: .filter (p -> Product: :ProductFilter: :isAvailable ())

Buy Now

Correct Answer: B

Questions 10

Given the code fragment: What is the result?

A. A compilation error occurs at line n1.

B. courseJava

C. Javacourse

D. A compilation error occurs at line n2.

Buy Now

Correct Answer: A

Questions 11

Given the code fragment:

What is the result?

A. text1text2

B. text1text2text2text3

C. text1

D. [text1, text2]

Buy Now

Correct Answer: A

Questions 12

Given the code fragments: and

What is the result?

A. Video played.Game played.

B. A compilation error occurs.

C. class java.lang.Exception

D. class java.io.IOException

Buy Now

Correct Answer: C

Questions 13

Given the code fragment:

Map books = new TreeMap<>();

books.put (1007, "A");

books.put (1002, "C");

books.put (1003, "B");

books.put (1003, "B");

System.out.println (books);

What is the result?

A. {1007=A, 1003=B, 1002=C}

B. {1007=A, 1003=B, 1003=B, 1002=C}

C. {1007=A, 1002=C, 1003=B, 1003=B}

D. {1002=C, 1003=B, 1007=A}

Buy Now

Correct Answer: D

Exam Code: 1Z0-809
Exam Name: Java SE 8 Programmer II
Last Update: May 30, 2026
Questions: 207

PDF (Q&A)

$45.99
ADD TO CART

VCE

$49.99
ADD TO CART

PDF + VCE

$59.99
ADD TO CART

Exam2Pass----The Most Reliable Exam Preparation Assistance

There are tens of thousands of certification exam dumps provided on the internet. And how to choose the most reliable one among them is the first problem one certification candidate should face. Exam2Pass provide a shot cut to pass the exam and get the certification. If you need help on any questions or any Exam2Pass exam PDF and VCE simulators, customer support team is ready to help at any time when required.

Home | Guarantee & Policy |  Privacy & Policy |  Terms & Conditions |  How to buy |  FAQs |  About Us |  Contact Us |  Demo |  Reviews

2026 Copyright @ exam2pass.com All trademarks are the property of their respective vendors. We are not associated with any of them.