R

Ram Sharma • 3.40K Points
Extraordinary

Q. What will happen if you call `stream()` on a null list?

  • (A) Returns empty stream
  • (B) Throws NullPointerException
  • (C) Returns null
  • (D) Throws IOException
  • Correct Answer - Option(B)
  • Views: 14
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
Calling `stream()` on a null object causes a `NullPointerException`.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.