How would you create an array with user input using the for-each loop structure?
I would normally do:
for (int i = 0; i < array.length; i++) {
System.out.println("Include a number into the array:");
array[i] = sc.nextInt();
}
How can I do the same thing but using a for-each style loop?