R

Ram Sharma • 3.40K Points
Extraordinary

Q. How can you collect strings from a stream and format them with prefix and suffix?

  • (A) Collectors.toString()
  • (B) Collectors.joining(", ", "[", "]")
  • (C) Collectors.groupingBy()
  • (D) Collectors.mapping()
  • Correct Answer - Option(B)
  • Views: 1
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`Collectors.joining(delimiter, prefix, suffix)` allows formatted string collection.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.