Jul 11, 2024
dataType[]
indicating an arraydataType[] arrayName;
arrayName = new dataType[size];
or dataType[] arrayName = {value1, value2, ...};
int[] rollNumbers = new int[5];
arr[0]
accesses the first elementnull
null
is a special literal valueScanner
for taking inputArrays.toString()
for easy printingfor(dataType element : arrayName) {
// code
}
int[][] arr = new int[3][4];
ArrayList<dataType> list = new ArrayList<>();