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

Viewing page 7 out of 9 pages
Viewing questions 61-70 out of questions
Questions # 61:

Given the code fragment:

Question # 61

How many lines of text does this program print?

Options:

A.

four


B.

one


C.

three


D.

two


Questions # 62:

Given the code fragment:

Question # 62

What is the result?

Options:

A.

0


B.

The program prints nothing.


C.

It prints 1 in infinite loop.


D.

1


E.

0


F.

1


Questions # 63:

Give:

Question # 63

And the code fragment:

Question # 63

Which three code fragments, at line n1 prints SPRING?

Options:

A.

System.out.printin (sA(1)};


B.

System.out.printin(Season,values(1)};


C.

System.out.printin(Season.SPRING);


D.

System.out.printin (sa(0)}:


E.

System.out.printin (Season.valueof(‘’SPRING”).ordinal() );


F.

System.out.printin(Season.valueOf(‘’SPRING”). Ordinal() );


G.

System.out.printin (Season.valueof (‘s’) );


Questions # 64:

Given the code fragment:

What is the result?

Options:

A.

[Lettuce, Kale]


B.

A compilation error is thrown.


C.

[Lettuce, Kale]

[Seabass, Salmon]


D.

[Kale, Lettuce]

[Salmon, Seabass]


Questions # 65:

Given:

Question # 65

and

checkQuality(QUALITY.A);

and

Question # 65

Which code fragment can be inserted into the switch statement to print Best?

Options:

A.

QUALITY.A.ValueOf()


B.

A


C.

A.toString()


D.

QUALITY.A


Questions # 66:

Given the code fragment:

Question # 66

Which code fragment replaces the for statement?

Options:

A.

IntStream.rangeClosed(l, 100).map(FizzBuzz::convert).forEach(System.out::println);


B.

IntStream.ranged, 100).map(FizzBuzz::convert).forEach(System.out::println);


C.

intstream.rangeclosed(l, 100).mapToObj{FizzBuzz::convert).forEach(System.out::printIn);


D.

IntStream.range(1, 100).mapToObj(FizzBuzz::convert).forEach(System.out::println);


Questions # 67:

Given the code fragment:

Question # 67

What should be inserted at line n1 so that the code fragment prints Name is required?

Options:

A.

name.trim() == '' ''

B name, isBlanl ()


B.

name. compareTo('' '') == 0


C.

name.isEmpty


Questions # 68:

Given:

Question # 68

Which one is correct?

Options:

A.

An IllegalThreadStateException is thrown at run time.


B.

Three threads are created.


C.

The compilation fails.


D.

Four threads are created.


Questions # 69:

Given:

Question # 69

You wants to make the reduction operation parallelized.

Which two modifications will accomplish this?

Options:

A.

Replace line 1 with int sum = numbers. Stream (). Interate (0, a -> a+1. Reduce (0, (n m) -> n+m);


B.

Replace line 1with int sum = numbers. ParallelStream ( ). Reduce (0, (n, m ) -> n + m);


C.

Replace line 1 with int sum = numbers. Parallel ( ). Stream ( ). Reduce (0, (n, m ) -> n + m);


D.

Replace line 1with int sum = number. Stream ( ) . flatMap (a -> a) .reduce (0, (n, m) -> n +m );


E.

Replace line 1with int sum = number.stream. parallel ( ). Reduce (0, (n, m) -> n + m);


Questions # 70:

Given the declaration:

Question # 70

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

Options:

A.

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


B.

@Resource(value={{}})


C.

@Resource


D.

@Resource(“Customer1”)


E.

@Resource()


Viewing page 7 out of 9 pages
Viewing questions 61-70 out of questions