0
Arrays
So Iām trying to work an array in which the first position [0] is a Scanner integer. Thus far, Iām returned with the error along the lines āvariable might not be initializedā. Any explanations/solutions? And also, how would one go about printing an entire array? I was thinking System.out.println(array[]) but Iām not sure. The code is having trouble saving so here is the array portion copy and pasted: ... int[] a; Scanner inp = new Scanner(System.in); int in= inp.nextInt(); a[0] = in; ...
1 Answer