Summer Special - Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: top65certs

Java SE 1z0-809 Exam Dumps

Page: 3 / 16
Total 208 questions

Java SE 8 Programmer II Questions and Answers

Question 9

Given:

What is the result?

Options:

A.

The program prints nothing.

B.

A compile-time error occurs.

C.

Exception is thrown.

D.

MyException is thrown.

Question 10

Which statement is true about the single abstract method of the java.util.function.Function interface?

Options:

A.

It accepts one argument and returns void.

B.

It accepts one argument and returns boolean.

C.

It accepts one argument and always produces a result of the same type as the argument.

D.

It accepts an argument and produces a result of any data type.

Question 11

Given:

Which is refactored code with functional interfaces?

Options:

A.

B.

C.

D.

Question 12

Given:

final class Folder {//line n1

//line n2

public void open () {

System.out.print(“Open”);

}

}

public class Test {

public static void main (String [] args) throws Exception {

try (Folder f = new Folder()) {

f.open();

}

}

}

Which two modifications enable the code to print Open Close? (Choose two.)

Options:

A.

Replace line n1 with:class Folder implements AutoCloseable {

B.

Replace line n1 with:class Folder extends Closeable {

C.

Replace line n1 with:class Folder extends Exception {

D.

At line n2, insert:final void close () {System.out.print(“Close”);}

E.

At line n2, insert:public void close () throws IOException {System.out.print(“Close”);}

Page: 3 / 16
Total 208 questions