Access array

Index to access elements in the array

1, remove the elements in the array

2, the elements of the array to modify

3, stored into the array element

format:

Array name [ array index ]

Index: each element of the array to store will automatically have a number, starting from 0, the number is automatically called array index (index)

note:

    1. Direct print array name is the address printed an array of values

    2. The index starts from 0, up to a maximum index "array length-1" are: the array length -1

    3. dynamically create an array, the array elements have a default value

            The default value of the integer type is 0

            The default value of float is 0.0

            The default value is the character '\ u0000'

            Boolean The default value is false

            The default value is null reference data types

      4. Create a static array, the array elements have a default value, but it was covered with an initialization

 

Length of the array:  

.Length array name is returned length of the array, is a value of type int

Guess you like

Origin www.cnblogs.com/libinhong/p/10988761.html