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 Resposta