In the code below my variable y asks for the user to enter values until y reaches 10, I make the storage in the variable x and the last information entered is currently stored (which shows at the end of the code) what I would like to know it is like doing an increment in var x, storing the information typed in x1, x2, x3..to x10, as with Y.
import java.util.Scanner;
public class SEP_06_exe2_p1{
public static void main(String args[]){
int x;
int y = 1;
do{
Scanner input = new Scanner(System.in);
System.out.print("Digite o " + y + "º valor: ");
x = input.nextInt();
y = ++y; //incrementa 1 no y
}while( y <= 10);
System.out.print(x);
}
}