0
How do I create an array with int and double as element types?
1 Respuesta
+ 1
To declare an array of 10 integers:
int[] arr = new int[10];
To declare an array of 10 doubles:
double[] arr = new double[10];
Note: round numbers can be stored in an array of double.
double[] arr = new double[3];
arr[0] = 1;
arr[1] = 2;
arr[2] = 3;