I'm not exactly sure what I have done but my goal is to accept 10 numbers from the user and store them into an array. In which I can then print back out in order received. I believe I have accomplished that with the exception of the first value is defaulting to zero in the output and I am not sure how to fix that. Any help?
package array;
import java.util.Scanner;
import java.util.Arrays;
public class Array {
public static void main(String[] args) {
int[] a = new int[10];
Scanner input = new Scanner(System.in);
System.out.println("Please enter ten numbers: ");
input.nextInt();
for(int j=0; j<10; j++)
a[j]=input.nextInt();
System.out.println("Your number list is:");
System.out.println(Arrays.toString(a));
}
}
}