Two-dimensional arrays:
One-dimensional array Beans
Two-dimensional array Form
Defined:
One-dimensional arrays:
Data type [] array variable name =new data type [ data length ];
Data type [] array variable name =new data type [ data length ]{1,2 , 3} ;
Two-dimensional arrays:
Array type [,] array variable = new data type [ number of rows, number of columns ];
int[,]a = new int [3,4];
Jagged arrays:
Data type [][]a = new data type [ number of rows ] []
Step two : define the decimal group
Data type []a1= new data type [ number of columns ]
Data type []a2= new data type [ number of columns ]
Step three: Put the decimal group in the Uncle Group
Collection
ArrayList a = new ArrayList ();
Add () append
Insert (,) inserts
A.removeat () Delete the first few
ArrayList linked list, no length limit, can add or remove elements at any time
You need to precede the using System.Collections.
Defined:
ArrayList a = new ArrayList ();
Operation:
Add ( data ) append
A.insert ( index number , data ) Insert
A.removeat ( index number ) Delete the first few
Count the number of elements in the collection.
Value:
a[ subscript ]
Two:List definition:
List < data type > A = new List < data type > ();
List <int > A = new list <int > ();
Operation:
A.add ( data ) append
A.insert ( index number , data ) Insert
A.removeat ( index number ) Delete the first few
A.count The number of elements in the collection.
Sort (); Sort Ascending
Revers (); reversal
Three:dictionary<key,value> dictionary or hash table
Defined:
Dictionary<int,int> a = new Dictionary <int, int > ();
Operation:
Add ( key value, data );
-
remove ( key value delete
a.count The number of elements in the collection.
value: a[ Span style= "font-family: the song Body;" > key value
stack< data type
Push ( value ); add
Data type variable name = A.pop ();
Queue: FIFO, cannot randomly take any of its values.
Queue a <>a = new queue <> ();
Enqueue (); Add
A.dequeue (); out
Collections and Arrays