What will be the result of calling method exists on empty Option?
val a = None

a.exists(_ == "text")
Explanation
exists is defined in a following way:
final def exists(p: (A) => Boolean): Boolean
Returns true if this option is nonempty and the predicate p returns true when applied to this Option's value.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Scala quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes