A

Admin • 828.03K Points
Coach

Q. Which method is used to get the last element in a TreeSet?

  • (A) last()
  • (B) end()
  • (C) top()
  • (D) getLast()
  • Correct Answer - Option(A)
  • Views: 11
  • Filed under category Java
  • Hashtags: Java Set

Explanation by: Admin
The `last()` method returns the greatest element in the TreeSet.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.