DONG NAI UNIVERSITY OF TECHNOLOGY
DONG NAI UNIVERSITY OF TECHNOLOGY
One Dimension Array
1
Multi Dimension Array
2
Array class
3
ArrayList class
4
Dictionary class
5
DONG NAI UNIVERSITY OF TECHNOLOGY
5297608
M[0] M[1] M[3] M[5]
M[2] M[4] M[6]
- Same name
- Same type
- Get Element by Index ( 0 n-1)
One Dimension Array
DONG NAI UNIVERSITY OF TECHNOLOGY
Programmer specifies the type of the elements
of the array
new operator to allocate dynamically the
number of elements in the array
Array declarations and initializations need not
be in the same statement
In arrays of value types, each element contains
one value of the declared type
Declaring & Creating Arrays
DONG NAI UNIVERSITY OF TECHNOLOGY
<DataType> [ ] <ArrayName>;
int [ ] M;
Button[ ] arrButton;
M=new int[10];
Button []arrButton=new Button[10];
Declaring:
ArrayName> =new <DataType>[ ARRAY_SIZ
Creating: