Note: Ending a loop with a break (you can jump to the label)
Use continue to ignore this loop to the remaining statement (you can also skip to the label)
Using the return End method
-type Array
An array is also a data type, which is itself a reference type
When defining the general use of type[] arrayname, this way is relatively easy to understand and formal
The array must be initialized before it can be used
Initialization: Static initialization arrayname = new Type{element1,element2,element3 ...}
Dynamic initialization arratname = new Type[length]
You cannot use both static and dynamic initialization: Specifying both the length of the array and the initial values for each array element
Using arrays
If the access array element is a specified index value of less than 0, or greater than the length of the array, an exception occurs at run time:
Java.lang.arrayindexoutofboundsexception:n (N is the array index you are trying to access)
-A Foreach Loop
for (Type Variablename:array | collection) { //variablename iterates over each element automatically }
When using a Foreach loop, you cannot change the value of an array element, so you cannot assign a value to a set of foreach arrays
-depth Array
Array elements and arrays of variables are stored separately in memory.
An array reference variable is simply a reference, and this reference variable can point to any valid memory, and the array element can be accessed through the array variable only if the reference points to valid memory
Reference variables are the fundamental way to access real objects
The actual array object is stored in heap memory, and if the array reference type referencing the array object is a local variable, it is stored in stack memory
Array reference variables are the fundamental way to access array elements in heap memory
If there is no longer any reference variable in the heap memory pointing to itself, then this array will be garbage collected by the garbage collection mechanism. So if you want to reclaim the memory space of an array, you can assign the array variable to NULL
Fourth. Flow control and Array