Summer Sale Special 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: ex2p65

Exact2Pass Menu

Java SE 8 Programmer II

Last Update 21 hours ago Total Questions : 208

The Java SE 8 Programmer II content is now fully updated, with all current exam questions added 21 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 # 4

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?

A.

Future f1 = (Future) es.submit (r1);es.execute (c1);

B.

es.execute (r1);Future f1 = es.execute (c1) ;

C.

Future f1 = (Future) es.execute(r1);Future f2 = (Future) es.execute(c1);

D.

es.submit(r1);Future f1 = es.submit (c1);

Question # 5

Given the code fragment:

What is the result?

A.

A compilation error occurs at line n1.

B.

Logged out at: 2015-01-12T21:58:19.880Z

C.

Can’t logout

D.

Logged out at: 2015-01-12T21:58:00Z

Question # 6

Given:

class FuelNotAvailException extends Exception { }

class Vehicle {

void ride() throws FuelNotAvailException {//line n1

System.out.println(“Happy Journey!”);

}

}

class SolarVehicle extends Vehicle {

public void ride () throws Exception {//line n2

super ride ();

}

}

and the code fragment:

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

Vehicle v = new SolarVehicle ();

v.ride();

}

Which modification enables the code fragment to print Happy Journey!?

A.

Replace line n1 with public void ride() throws FuelNotAvailException {

B.

Replace line n1 with protected void ride() throws Exception {

C.

Replace line n2 with void ride() throws Exception {

D.

Replace line n2 with private void ride() throws FuelNotAvailException {

Question # 7

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

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 # 8

Given the code fragment:

What is the result?

A.

text1text2

B.

text1text2text2text3

C.

text1

D.

[text1, text2]

Question # 9

Given the code fragment:

Which modification enables the code to print Price 5 New Price 4?

A.

Replace line n2 with .map (n -> System.out.println (“New Price” + n –1)) and remove line n3

B.

Replace line n2 with .mapToInt (n -> n – 1);

C.

Replace line n1 with .forEach (e -> System.out.print (“Price” + e))

D.

Replace line n3 with .forEach (n -> System.out.println (“New Price” + n));

Question # 10

Given the code fragments:

public class Book implements Comparator {

String name;

double price;

public Book () {}

public Book(String name, double price) {

this.name = name;

this.price = price;

}

public int compare(Book b1, Book b2) {

return b1.name.compareTo(b2.name);

}

public String toString() {

return name + “:” + price;

}

}

and

Listbooks = Arrays.asList (new Book (“Beginning with Java”, 2), new book (“A

Guide to Java Tour”, 3));

Collections.sort(books, new Book());

System.out.print(books);

What is the result?

A.

[A Guide to Java Tour:3.0, Beginning with Java:2.0]

B.

[Beginning with Java:2, A Guide to Java Tour:3]

C.

A compilation error occurs because the Book class does not override the abstract method compareTo().

D.

An Exception is thrown at run time.

Go to page: