This is what I tried, but it doesn't work as I expected.
package javaCourseNumberArray.copy;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int[] a = new int[5];
System.out.println("6 numbers quick... i don't like big ones btw.");
int x ;
int y = 0;
while (y < 5) {
x = sc.nextInt();
if(x>10) {
a[y] = (int)x;
y++;
}
else {
System.out.println("Pick a number beetween 0 and 9");
}
}
for (int m : a) {
System.out.println(a[m]);
}
}
}