Array in Java

xiaoxiao2021-03-06  61

First, statement

INT INTAARRAY []; a full array, each element in the array is integer data. Unlike C, C , Java does not assign memory in array elements in the definition of arrays, so [] does not need to indicate the number of elements in the array, that is, the array length, and any array as defined above cannot access it. Element. We must distribute memory spaces, which should be used to use the operator New, which is equipped with: ArrayName = New Type [arraysize]; ARRAYSIZE indicates the length of the array. If: INTARRAY = New Int [3];

Different from C, C , Java to check the array elements to check the alliance. At the same time, there is a attribute Length to each array indicate its length, such as: INTARRAY.LENGTH refers to the length of the array INTARRAY.

转载请注明原文地址:https://www.9cbs.com/read-119208.html

New Post(0)