R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which method can be used to convert a Set to a List?

  • (A) new ArrayList<>(set)
  • (B) Arrays.asList(set)
  • (C) Collections.list(set)
  • (D) set.toList()
  • Correct Answer - Option(A)
  • Views: 12
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
You can use the constructor `new ArrayList<>(set)` to convert a set into a list.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.