_______ in slices in Go refers to the maximum number of elements that the slice can hold without reallocating memory.

  • length
  • capacity
  • size
  • dimension
The correct option is capacity. Capacity in Go slices denotes the maximum number of elements that the slice can accommodate without needing to reallocate memory. It's a crucial aspect for understanding slice efficiency and avoiding unnecessary allocations.
Add your answer
Loading...

Leave a comment

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