Spring Sale Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: buysanta

Exact2Pass Menu

Java SE 8 Programmer II

Last Update 9 hours ago Total Questions : 208

The Java SE 8 Programmer II content is now fully updated, with all current exam questions added 9 hours ago. Deciding to include 1z0-809 practice exam questions in your study plan goes far beyond basic test preparation.

You'll find that our 1z0-809 exam questions frequently feature detailed scenarios and practical problem-solving exercises that directly mirror industry challenges. Engaging with these 1z0-809 sample sets allows you to effectively manage your time and pace yourself, giving you the ability to finish any Java SE 8 Programmer II practice test comfortably within the allotted time.

Question # 51

Assume customers.txt is accessible and contains multiple lines.

Which code fragment prints the contents of the customers.txt file?

A.

Stream < String > stream = Files.find (Paths.get (“customers.txt”));stream.forEach((String c) - > System.out.println(c));

B.

Stream < Path > stream = Files.find (Paths.get (“customers.txt”));stream.forEach( c) - > System.out.println(c));

C.

Stream < Path > stream = Files.list (Paths.get (“customers.txt”));stream.forEach( c) - > System.out.println(c));

D.

Stream < String > lines = Files.lines (Paths.get (“customers.txt”));lines.forEach( c) - > System.out.println(c));

Question # 52

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 < Product > products = Arrays.asList(new Product(1, 10),

new Product (2, 30),

new Product (2, 30));

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.

2 : 30

B.

4 : 0

C.

4 : 70

D.

4 : 602 : 303 : 201 : 10

E.

The program prints nothing.

Question # 53

Given the content of the employee.txt file:

Every worker is a master.

Given that the employee.txt file is accessible and the file allemp.txt does NOT exist, and the code fragment:

What is the result?

A.

Exception 1

B.

Exception 2

C.

The program executes, does NOT affect the system, and produces NO output.

D.

allemp.txt is created and the content of employee.txt is copied to it.

Question # 54

What is true about the java.sql.Statement interface?

A.

It provides a session with the database.

B.

It is used to get an instance of a Connection object by using JDBC drivers.

C.

It provides a cursor to fetch the resulting data.

D.

It provides a class for executing SQL statements and returning the results.

Question # 55

Given the code fragment:

Stream < List < String > > iStr= Stream.of (

Arrays.asList (“1”, “John”),

Arrays.asList (“2”, null)0;

Stream < < String > nInSt = iStr.flatMapToInt ((x) - > x.stream ());

nInSt.forEach (System.out :: print);

What is the result?

A.

1John2null

B.

12

C.

A NullPointerException is thrown at run time.

D.

A compilation error occurs.

Question # 56

Given the code fragments :

and

What is the result?

A.

TV Price :110 Refrigerator Price :2100

B.

A compilation error occurs.

C.

TV Price :1000 Refrigerator Price :2000

D.

The program prints nothing.

Question # 57

Given:

and the code fragment:

What is the result?

A.

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

B.

Java EEJava ME

C.

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

D.

A compilation error occurs.

Question # 58

Given the code fragment:

List < Integer > codes = Arrays.asList (10, 20);

UnaryOperator < Double > uo = s - > s +10.0;

codes.replaceAll(uo);

codes.forEach(c - > System.out.println(c));

What is the result?

A.

20.030.0

B.

1020

C.

A compilation error occurs.

D.

A NumberFormatException is thrown at run time.

Question # 59

Given the code fragment:

ZonedDateTime depart = ZonedDateTime.of(2015, 1, 15, 1, 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.

Question # 60

Given the code fragment:

BiFunction < Integer, Double, Integer > val = (t1, t2) - > t1 + t2;//line n1

System.out.println(val.apply(10, 10.5));

What is the result?

A.

20

B.

20.5

C.

A compilation error occurs at line n1.

D.

A compilation error occurs at line n2.

Go to page: