Weekend Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code = simple70

Pass the Oracle Java SE 1z0-809 Questions and answers with ExamsMirror

Practice at least 50% of the questions to maximize your chances of passing.
Exam 1z0-809 Premium Access

View all detail and faqs for the 1z0-809 exam


392 Students Passed

96% Average Score

92% Same Questions
Viewing page 1 out of 7 pages
Viewing questions 1-10 out of questions
Questions # 1:

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.

Questions # 2:

Given the definition of the Book class:

Question # 2

Which statement is true about the Book class?

Options:

A.

It demonstrates encapsulation.

B.

It is defined using the factory design pattern.

C.

It is defined using the singleton design pattern.

D.

It demonstrates polymorphism.

E.

It is an immutable class.

Questions # 3:

Given:

Question # 3

and the code fragment:

Question # 3

What is the result?

Options:

A.

A compilation error occurs at line n2.

B.

A compilation error occurs because the try block doesn’t have a catch or finally block.

C.

A compilation error occurs at line n1.

D.

The program compiles successfully.

Questions # 4:

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

Options:

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.

Questions # 5:

Given the code fragments:

Question # 5

and

Question # 5

Which two modifications enable to sort the elements of the emps list? (Choose two.)

Options:

A.

Replace line n1 withclass Person extends Comparator

B.

At line n2 insertpublic int compareTo (Person p) {return this.name.compareTo (p.name);}

C.

Replace line n1 withclass Person implements Comparable

D.

At line n2 insertpublic int compare (Person p1, Person p2) {return p1.name.compareTo (p2.name);}

E.

At line n2 insert:public int compareTo (Person p, Person p2) {return p1.name.compareTo (p2.name);}

F.

Replace line n1 withclass Person implements Comparator

Questions # 6:

Question # 6

and the code fragment?

Question # 6

What is the result?

Options:

A.

$15.00

B.

15 $

C.

USD 15.00

D.

USD $15

Questions # 7:

Given the code fragments:

Question # 7

and

Question # 7

What is the result?

Options:

A.

FranceOptional[NotFound]

B.

Optional [France]Optional [NotFound]

C.

Optional[France]Not Found

D.

FranceNot Found

Questions # 8:

Given the code fragment:

List values = Arrays.asList (1, 2, 3);

values.stream ()

.map(n -> n*2)//line n1

.peek(System.out::print)//line n2

.count();

What is the result?

Options:

A.

246

B.

The code produces no output.

C.

A compilation error occurs at line n1.

D.

A compilation error occurs at line n2.

Questions # 9:

Given that /green.txt and /colors/yellow.txt are accessible, and the code fragment:

Path source = Paths.get(“/green.txt);

Path target = Paths.get(“/colors/yellow.txt);

Files.move(source, target, StandardCopyOption.ATOMIC_MOVE);

Files.delete(source);

Which statement is true?

Options:

A.

The green.txt file content is replaced by the yellow.txt file content and the yellow.txt file is deleted.

B.

The yellow.txt file content is replaced by the green.txt file content and an exception is thrown.

C.

The file green.txt is moved to the /colors directory.

D.

A FileAlreadyExistsException is thrown at runtime.

Questions # 10:

Which two methods from the java.util.stream.Stream interface perform a reduction operation? (Choose two.)

Options:

A.

count ()

B.

collect ()

C.

distinct ()

D.

peek ()

E.

filter ()

Viewing page 1 out of 7 pages
Viewing questions 1-10 out of questions
TOP CODES

TOP CODES

Top selling exam codes in the certification world, popular, in demand and updated to help you pass on the first try.