1int intArray[]; //declaring array
2intArray = new int[20]; // allocating memory to array
3//OR
4int[] intArray = new int[20]; // combining both statements in one
1int number = 110101;
2String temp = Integer.toString(number);
3int[] numbers = new int[temp.length()];
4for (int i = 0; i < temp.length(); i++) {
5 numbers[i] = temp.charAt(i) - '0';
6}
1int[] theNumbers = new int[5];
2
3arr[0] = 4;
4arr[1] = 8;
5arr[2] = 15;
6arr[3] = 16;
7arr[4] = 23;
8arr[5] = 42;
1int[] arr = new int[5]; // integer array of size 5 you can also change data type
2