A

Admin • 833.24K Points
Coach

Q. What is the output of `Arrays.asList("a", "b").forEach(System.out::println);`?

  • (A) No output
  • (B) Prints 'a' and 'b' on separate lines
  • (C) Prints 'ab'
  • (D) Compilation error

Explanation by: Admin

The method reference prints each element on a separate line.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.