In an array, the ___________ gives the maximum number of elements that can be stored.

  • Size
  • Length
  • Capacity
  • Count
The correct option is "Capacity." In arrays, capacity refers to the total number of elements that can be stored. It is determined during the array's initialization and remains fixed unless the array is resized. The capacity of an array is distinct from its size, which refers to the number of elements currently stored in the array. Understanding the capacity is crucial for managing memory efficiently when working with arrays.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *