Multiple Choice
Consider the following pseudocode that returns an Optional value from a method:
if there is a result // line 1
return the result // line 2
else
return an empty result // line 3
Assume that the variable result represents an object reference to the result to be returned as Optional.Replace line 1 with the Java code to determine whether there is a result.
A) if (result.ifPresent() )
B) if (result == null)
C) if (result != null)
D) if (result.isPresent() )
Correct Answer:

Verified
Correct Answer:
Verified
Q66: Which statement creates a stream of String
Q67: Which statement creates a stream from an
Q68: Complete the following statement that finds the
Q69: Complete the following code snippet to display
Q70: Which Java interface is NOT a functional
Q72: Complete the following statement that uses streams
Q73: Which method of the Stream class can
Q74: Which statement about lambda expressions is NOT
Q75: Which method yields a new stream with
Q76: Complete the following code snippet that returns