Array [5]

1, array definition

Concept array: the array of data is stored in a fixed length container, a plurality of types of data to ensure that the data to be consistent.

Note: the fixed-length array of properties, once the specified length, can not be changed.

A way, dynamic initialization

 For example:

 Second way, static initialization

 For example:

Method three, static initialization

 For example:

 2, array accesses

Access: array name [index] (index starts from 0.)

 

Length property of the array: array name .length

 3, an array of common exceptions

3.1 array bounds exception

3.2 null pointer exception

 4, array traversal

1, array traversal

 2, the array takes a maximum value

 3, an array of inverted & array as a parameter as a return parameter & array

 

5, the array is stored in memory

1, a memory array of FIG.

2, two memory arrays of FIG.

 

3, two variable points to a memory array of FIG.

 

 

Guess you like

Origin www.cnblogs.com/crystal1126/p/12612551.html
Recommended