A

Admin • 833K Points
Coach

Q. What is the result of `HashSet.toArray(new Integer[0])`?

  • (A) Integer array with all elements
  • (B) Compilation error
  • (C) ArrayIndexOutOfBoundsException
  • (D) null
  • Correct Answer - Option(A)
  • Views: 21
  • Filed under category Java
  • Hashtags: Java Set

Explanation by: Admin

The `toArray()` method fills the provided array or creates a new one if needed.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.