Java String array: is there a size of method?

后端 未结 11 2036
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-27 03:38

I come from a php background and in php, there is an array_size() function which tells you how many elements in the array are used.

Is there a similar

11条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 03:59

    array.length final property

    it is public and final property. It is final because arrays in Java are immutable by size (but mutable by element's value)

提交回复
热议问题