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

Viewing page 8 out of 9 pages
Viewing questions 71-80 out of questions
Questions # 71:

Given the code fragment:

Question # 71

What is the result?

Options:

A.

2


B.

-1


C.

1


D.

-3


Questions # 72:

Which statement about access modifiers is correct?

Options:

A.

An instance variable can be declared with the static modifier.


B.

A local variable can be declared with the final modifier.


C.

An abstract method can be declared with the private modifier.


D.

An inner class cannot be declared with the public modifier.


E.

An interface can be declared with the protected modifier.


Questions # 73:

Given the code fragment:

Question # 73

What is the result?

Options:

A.

false true true


B.

true false false


C.

false false true


D.

false true false


Questions # 74:

Given:

Question # 74

executed with this command:

java Main one two three

What is the result?

Options:

A.

0). one


B.

0). one1). two2). three


C.

The compilation fails.


D.

It creates an infinite loop printing:0). one1). two1). two...


E.

A java.lang.NullPointerException is thrown.


Questions # 75:

Given:

Question # 75

What is the result?

Options:

A.

5


B.

3


C.

23


D.

25


E.

11


Questions # 76:

Given:

LocalDate d1 = LocalDate.of(1997,2,7);

DateTimeFormatter dtf =

DateTimeFormatter.ofPattern( /*insert code here*/ );

System.out.println(dtf.format (d1));

Which pattern formats the date as Friday 7th of February 1997?

Options:

A.

“eeee dd+”th of”+ MMM yyyy”


B.

“eeee dd'th of' MMM yyyy”


C.

“eeee d+”th of”+ MMMM yyyy”


D.

“eeee d’th of’ MMMM yyyy”


Questions # 77:

Given:

Question # 77

Which is true?

Options:

A.

The code compiles but does not print any result.


B.

The code prints 25.


C.

The code does not compile.


D.

The code throws an exception at runtime.


Questions # 78:

Given:

Question # 78

What is the result?

Options:

A.

b1


B.

2


C.

b2


D.

1


E.

b3


F.

3


G.

The compilation fails due to an error in line 1.


Questions # 79:

Given:

Question # 79

What is the output?

Options:

A.

Short value 25


B.

The compilation fails due to an error in line 1.


C.

Byte value 25


D.

Object value 25


Questions # 80:

Given:

Question # 80

Which two statements can be added at line 1 in Bar to successfully compile it? (Choose two.)

Options:

A.

public List foo(Set m) { ... }


B.

public ArrayList foo(Set m) { ... }


C.

public List foo(TreeSet m) { ... }


D.

public List foo(Set m) { ... }


E.

public List foo(Set m) { ... }


F.

public ArrayList foo(Set m) { ... }


Viewing page 8 out of 9 pages
Viewing questions 71-80 out of questions