public class Program {
public static void main(String[] args){
int[] numbers = new int[10];
for (int i = 0; i < 10; i++) {
numbers[i]=i+1;
}
for (int i : numbers) {
System.out.println(i);
}
}
}
solved Count from 1-10 using a loop with return values to a 10-element sized single-dimensional array