R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which method returns the number of elements in a collection?

  • (A) length()
  • (B) getSize()
  • (C) count()
  • (D) size()
  • Correct Answer - Option(D)
  • Views: 12
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`size()` is used to get the number of elements in a collection.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.