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

1z0-809 Exam Dumps - Oracle Java SE Questions and Answers

Question # 4

Given:

public interface Moveable {

public default void walk (Integer distance) {System.out.println(“Walking”);)

public void run(Integer distance);

}

Which statement is true?

Options:

A.

Moveable can be used as below:Moveable animal = n - > System.out.println(“Running” + n);animal.run(100);animal.walk(20);

B.

Moveable can be used as below:Moveable animal = n - > n + 10;animal.run(100);animal.walk(20);

C.

Moveable can be used as below:Moveable animal = (Integer n) - > System.out.println(n);animal.run(100);Moveable.walk(20);

D.

Movable cannot be used in a lambda expression.

Buy Now
Question # 5

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.

Buy Now
Question # 6

Given the code fragment:

What is the result?

Options:

A.

[X][X, X][X, X, X][X, X, X, X]

B.

[X, X]

C.

[X][X, X][X, X, X]

D.

[X, X][X, X, X, X]

Buy Now
Question # 7

Given the code fragment:

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

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

What is the result?

Options:

A.

20

B.

20.5

C.

A compilation error occurs at line n1.

D.

A compilation error occurs at line n2.

Buy Now
Question # 8

Given:

From what threading problem does the program suffer?

Options:

A.

race condition

B.

deadlock

C.

starvation

D.

livelock

Buy Now
Question # 9

Given the code fragment:

9. Connection conn = DriveManager.getConnection(dbURL, userName, passWord);

10. String query = “SELECT id FROM Employee”;

11. try (Statement stmt = conn.createStatement()) {

12. ResultSet rs = stmt.executeQuery(query);

13.stmt.executeQuery(“SELECT id FROM Customer”);

14. while (rs.next()) {

15. //process the results

16.System.out.println(“Employee ID: “+ rs.getInt(“id”));

17.}

18. } catch (Exception e) {

19. System.out.println (“Error”);

20. }

Assume that:

The required database driver is configured in the classpath.

The appropriate database is accessible with the dbURL, userName, and passWord exists.

The Employee and Customer tables are available and each table has id column with a few records and the SQL queries are valid.

What is the result of compiling and executing this code fragment?

Options:

A.

The program prints employee IDs.

B.

The program prints customer IDs.

C.

The program prints Error.

D.

compilation fails on line 13.

Buy Now
Question # 10

Given the definition of the Emp class:

public class Emp

private String eName;

private Integer eAge;

Emp(String eN, Integer eA) {

this.eName = eN;

this.eAge = eA;

}

public Integer getEAge () {return eAge;}

public String getEName () {return eName;}

}

and code fragment:

Listli = Arrays.asList(new Emp(“Sam”, 20), New Emp(“John”, 60), New Emp(“Jim”, 51));

Predicate agVal = s -> s.getEAge() > 50;//line n1

li = li.stream().filter(agVal).collect(Collectors.toList());

Stream names = li.stream()map.(Emp::getEName);//line n2

names.forEach(n -> System.out.print(n + “ “));

What is the result?

Options:

A.

Sam John Jim

B.

John Jim

C.

A compilation error occurs at line n1.

D.

A compilation error occurs at line n2.

Buy Now
Question # 11

Given the code fragment:

Path source = Paths.get (“/data/december/log.txt”);

Path destination = Paths.get(“/data”);

Files.copy (source, destination);

and assuming that the file /data/december/log.txt is accessible and contains:

10-Dec-2014 – Executed successfully

What is the result?

Options:

A.

A file with the name log.txt is created in the /data directory and the content of the /data/december/log.txt file is copied to it.

B.

The program executes successfully and does NOT change the file system.

C.

A FileNotFoundException is thrown at run time.

D.

A FileAlreadyExistsException is thrown at run time.

Buy Now
Question # 12

Which two statements are true about the Fork/Join Framework? (Choose two.)

Options:

A.

The RecursiveTask subclass is used when a task does not need to return a result.

B.

The Fork/Join framework can help you take advantage of multicore hardware.

C.

The Fork/Join framework implements a work-stealing algorithm.

D.

The Fork/Join solution when run on multicore hardware always performs faster than standard sequential solution.

Buy Now
Question # 13

Given:

Which is refactored code with functional interfaces?

Options:

A.

B.

C.

D.

Buy Now
Exam Code: 1z0-809
Exam Name: Java SE 8 Programmer II
Last Update: Aug 17, 2025
Questions: 208
1z0-809 pdf

1z0-809 PDF

$29.75  $84.99
1z0-809 Engine

1z0-809 Testing Engine

$33.25  $94.99
1z0-809 PDF + Engine

1z0-809 PDF + Testing Engine

$47.25  $134.99