Pass the Oracle Java SE 1z0-819 Questions and answers with CertsForce

Viewing page 4 out of 9 pages
Viewing questions 31-40 out of questions
Questions # 31:

Given:

Question # 31

What is the result?

Options:

A.

2-4


B.

0-6

1-5

2-4


C.

1-5


D.

1-5

2-4


E.

The compilation fails due to an error in line 1.


F.

0-6


G.

0-6

2-4


Questions # 32:

Given:

Question # 32

And the commands:

What is the result on execution of these commands?

A)

Question # 32

B)

Question # 32

C)

Question # 32

D)

Question # 32

Options:

A.

Option A


B.

Option B


C.

Option C


D.

Option D


Questions # 33:

Given the code fragment:

Question # 33

What is the output?

Options:

A.

The compilation fails.


B.

[-1, -2, -3]


C.

[-3, -2, -1]


D.

A runtime exception is thrown.


Questions # 34:

You replace the code on line 1 to use ParallelStream.

Question # 34

Which one is correct?

Options:

A.

The code will produce the same result.


B.

The compilation fails.


C.

A NoSuchElementException is thrown at run time.


D.

The code may produce a different result.


Questions # 35:

Given:

Question # 35

What is the output?

Options:

A.

1 2 [1, 2, 3, four] 3 four


B.

1 2 [1, 2, 3, 4] 3 4


C.

1 2 [1, 2, 3, 4] 3 four


D.

1 2 [1, 2, 3, four] 3 4


Questions # 36:

Given:

Question # 36

What is the result?

Options:

A.

The compilation fails.


B.

-3


C.

An exception is thrown at runtime.


D.

-2


Questions # 37:

Given:

Question # 37

Why does D cause a compilation error?

Options:

A.

D inherits a() only from C.


B.

D inherits a() from B and C but the return types are incompatible.


C.

D extends more than one interface.


D.

D does not define any method.


Questions # 38:

Given the code fragment:

Question # 38

You want to validate a path name before the read file. Before validation, all path names should be canonicalized.

Which code inserted on line nl will accomplish this?

A)

Question # 38

B)

Question # 38

C)

Question # 38

D)

Question # 38

Options:

A.

Option A


B.

Option B


C.

Option C


D.

Option D


Questions # 39:

Which code is correct?

Options:

A.

Runnable r = “Message” −> System.out.println();


B.

Runnable r = () −> System.out::print;


C.

Runnable r = () -> {System.out.println(“Message”);};


D.

Runnable r = −> System.out.println(“Message”);


E.

Runnable r = {System.out.println(“Message”)};


Questions # 40:

Given the code fragment from Box. Java:

Question # 40

Given the code fragment from item.java:

Question # 40

Given the information:

The classes Box and items are encapsulated with getters and setters methods. The classes Box and Item contains required constructors source code.

and the code fragment:

Question # 40

Which action serializes the b1 object?

Options:

A.

Handle NoteSerilaizeableException in the try clause or throw in the main() method definition.


B.

Remove out.flush () method invocation.


C.

Implement the Serializable interface in the item class.


D.

Override readObject () and writeObject () method in the Book class.


E.

Add SerialVersionID to the Box and item class


Viewing page 4 out of 9 pages
Viewing questions 31-40 out of questions