java base (4) --- array

First, the array

format:

1. Data Type [] array name;

2. The name of the data type array []; (not recommended)

 

 

 

 

 

 Dynamic Initialization:

  Data Type [] = new Array Data Type Name [array length]

  

Defaults:

 

 

 Access array elements:

  Direct access to the array name , return [I @ ......, which [show is an array, I represent Int type @ followed by the address .

 

 

 

 Access elements in the array: starting at 0, and the index is not negative.

Changing array element:  Array name [index] = Assignment

 

 

 

Static Initialization:

 

 

 

 

 

 method:

  Gets an array of length: array name .length

 

Guess you like

Origin www.cnblogs.com/Lee-yl/p/11621185.html