Fourth day
To logically turn large programs into one small step
An array is a combination of multiple identical types of data that enables unified management of these data.
The elements in the array can be any data type, including the base type and the application type.
Declaring the format of an array
Declaring the format of an array
1, data type [] array name
2, data type array name []
Note: The value range of the subscript:0-----Array Length-1
Static initialization
/Initialize, specify the value of the element, determined by the system length
int [] arr = new int[]{1,2,3,5};
/*
* Array FAQ:
* 1. Array subscript out of bounds exception
* Java.lang.ArrayIndexOutOfBoundsException
* The subscript does not go out of scope, and it occurs when an index that does not exist in the array is accessed
* 2. Null pointer exception
* Java.lang.NullPointerException
* Array reference does not point to an entity, but when manipulating an element in an entity
*/
Java Foundation Fourth day