I'm trying to get a bunch of numbers as input, and output it as first an unsorted array, then a sorted one. How do I store the inputted values inside the array within the for loop? Right now, it only stores the last value inputted.
String strNumberOfValues, strValue;
int intNumberOfValues, intValue;
Scanner input = new Scanner(System. in );
System.out.println("Please enter the number of values you would like to enter");
strNumberOfValues = input.nextLine();
intNumberOfValues = Integer.parseInt(strNumberOfValues);
for (int i = 0; i < intNumberOfValues; i++) {
System.out.println("Please enter value for index value of " + i);
strValue = input.nextLine();
intValue = Integer.parseInt(strValue);
for (int j = 0; j == 0; j++) {
int[] intArray = {
intValue
};
System.out.println("Here is the unsorted list: \n" + Arrays.toString(intArray));