Summer Sale Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: ecus65

Oracle 1z0-819 - Java SE 11 Developer

Page: 5 / 9
Total 296 questions

Given:

You want to implement the java.io.Serializable interface to the MyPersistenceData class.

Which method should be overridden?

A.

the readExternal method

B.

nothing

C.

the readExternal and writeExternal method

D.

the writeExternal method

Which two statements set the default locale used for formatting numbers, currency, and percentages? (Choose two.)

A.

Locale.setDefault(Locale.Category.FORMAT, “zh-CN”);

B.

Locale.setDefault(Locale.Category.FORMAT, Locale.CANADA_FRENCH);

C.

Locale.setDefault(Locale.SIMPLIFIED_CHINESE);

D.

Locale.setDefault(“en_CA”);

E.

Locale.setDefault(“es”, Locale.US);

Given:

What code inserted into class C would allow it to compile?

A.

public void x() { }

public void z() { }

B.

public void x() { }

protected void y() { super.y(); }

public void z() { }

C.

void x() { }

public void y() { }

public void z() { }

D.

void x() { super.y(); }

public void z() { }

E.

void x() { }

public void z() { }

Given the declaration:

Which two annotations may be applied at Loc1 in the code fragment? (Choose two.)

A.

@Resource({“Customer1”, “Customer2”})

B.

@Resource(value={{}})

C.

@Resource

D.

@Resource(“Customer1”)

E.

@Resource()

Given:

What is the result?

A.

It throws a runtime exception.

B.

Value of Euler = 2.71828

C.

The code does not compile.

D.

Value of Euler = “2.71828”

Given:

Which two interfaces can be used in lambda expressions? (Choose two.)

A.

MyInterface1

B.

MyInterface3

C.

MyInterface5

D.

MyInterface2

E.

MyInterface4

Given:

What will secure this code from a potential Denial of Service condition?

A.

After Line 4, add indexReader.close().

B.

On Line 3, enclose processData(dataReader) with try with resources.

C.

After Line 3, add dataReader.close().

D.

On Line 1, use try with resources when opening each dataReader.

E.

Before Line 1, check the size of dataFiles to make sure it does not exceed a threshold.

Given:

What is the result?

A.

[A, B, C]

[A, B, C]

B.

On line 9, an exception is thrown at run time.

C.

[A, B, C]

[ B, C]

D.

[A, B, C]

followed by an exception thrown on line 11.

Given the code fragment:

var pool = Executors.newFixedThreadPool(5);

Future outcome = pool.submit(() −> 1);

Which type of lambda expression is passed into submit()?

A.

java.lang.Runnable

B.

java.util.function.Predicate

C.

java.util.function.Function

D.

java.util.concurrent.Callable

Given:

Which two lines can replace line 1 so that the Y class compiles? (Choose two.)

A.

map.forEach((k, v) -> set(v)));

B.

set(map.values());

C.

super.set(List map)

D.

super.set(map.values());

E.

set(map)