Array Length in Java

前端 未结 16 1485
忘了有多久
忘了有多久 2020-11-30 21:27

I declared an array as shown below:

int[] arr = new int[10];

Then I assigned following values to the array:

arr[0] = 1;
arr         


        
16条回答
  •  甜味超标
    2020-11-30 22:16

    It contains the allocated size, 10. The remaining indexes will contain the default value which is 0.

提交回复
热议问题