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

Java SE 1z0-809 Dumps PDF

Page: 4 / 16
Total 208 questions

Java SE 8 Programmer II Questions and Answers

Question 13

Given the structure of the EHF and DEPT tables:

Given the code fragment:

What is the result?

Options:

A.

The code prints all of the records in the EM? table but not with the respective department names.

B.

The code prints all of the records in the EMP table along with the respective department names.

C.

The code throws a syntax error at ResultSet because the semicolon (:) is missing.

D.

The code prints only the first record of the EM? table.

Question 14

Given the code fragment:

Assume that the value of now is 6:30 in the morning.

What is the result?

Options:

A.

An exception is thrown at run time.

B.

0

C.

60

D.

1

Question 15

Given:

class Book {

int id;

String name;

public Book (int id, String name) {

this.id = id;

this.name = name;

}

public boolean equals (Object obj) { //line n1

boolean output = false;

Book b = (Book) obj;

if (this.name.equals(b name))}

output = true;

}

return output;

}

}

and the code fragment:

Book b1 = new Book (101, “Java Programing”);

Book b2 = new Book (102, “Java Programing”);

System.out.println (b1.equals(b2)); //line n2

Which statement is true?

Options:

A.

The program prints true.

B.

The program prints false.

C.

A compilation error occurs. To ensure successful compilation, replace line n1 with:boolean equals (Book obj) {

D.

A compilation error occurs. To ensure successful compilation, replace line n2 with:System.out.println (b1.equals((Object) b2));

Question 16

Given the code fragment:

List nL = Arrays.asList(“Jim”, “John”, “Jeff”);

Function funVal = s -> “Hello : “.concat(s);

nL.Stream()

.map(funVal)

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

What is the result?

Options:

A.

Hello : Jim Hello : John Hello : Jeff

B.

Jim John Jeff

C.

The program prints nothing.

D.

A compilation error occurs.

Page: 4 / 16
Total 208 questions