<> The first 9 chapter array

Array is a very important set type in computer language , In most computer languages, arrays have the following three basic characteristics :
1. uniformity : Arrays can only hold elements of the same data type , The data type of an element can be any of the same data types .
2. Order : Elements in an array are ordered , Access by subscript .
3. Immutability : Once the array is initialized , Length ( Number of elements in the array ) Immutable .

stay Java The subscript of the array in is zero based , In fact, in many computer languages, array subscripts start at zero .Java Array subscript access operator is bracket , as intArray[0], Indicates access intArray First element of array ,0 Is the subscript of the first element .
in addition ,Java The array in is itself a reference data type , Its length attribute is length. Arrays can be divided into : One dimensional array and multidimensional array , Let's start with a one-dimensional array .

<>9.1 One dimensional array

When each element in an array has only one subscript , This kind of array is “ One dimensional array ”. Arrays are reference data types , There are two things to do before using reference data types : Declaration and initialization .
9.1.1 Array declaration
The declaration of an array declares the element types in the array , Variable name of array .

The syntax of array declaration is as follows :
Element data type [] Array variable name ;
Element data type Array variable name [];
Visible arrays can be declared in two forms : One is two brackets ([]) After element data type ; The other is two brackets ([]) Follow variable name .

An example of array declaration is as follows :
int intArray[];
float[] floatArray;
String strArray[];
Date[] dateArray;
9.1.2 Array initialization
The array is initialized when the declaration is completed , The process of array initialization is to allocate memory space for each element of the array , And provide initial values for each element . After initialization, the length of the array is determined and cannot be changed

©2019-2020 Toolsou All rights reserved,
vue monitor Treeselect Change of options Determine whether the current object is an array 4 Methods ( Essence )2020 year 6 month 26 day C# Class library read json Profile help class Python realization switch method ( Essence )2020 year 6 month 29 day C# Class library Interface signature verification springboot Multi profile configuration Output string at specified position ( Detailed analysis )python Dynamic programming for single source shortest path pytorch of ResNet18( Yes cifar10 The accuracy of data classification is achieved 94%)( Essence 2020 year 6 month 3 Daily update ) TypeScript Detailed explanation of Chinese interface