0

How do I create an array with int and double as element types?

15th Oct 2016, 12:56 PM
Irono Griel
Irono Griel - avatar
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;
15th Oct 2016, 1:40 PM
Zen
Zen - avatar