Hi how in java we can limit numbers of integers a certain user input? Below is my code of accepting user inputs, how can i ensure that only accept 5 integers from users? Thanks
public static void main(String args[])
{
int a;
Scanner in = new Scanner(System.in);
System.out.println("Enter a string");
a = in.nextInt();
System.out.println("You entered integer "+a);
}
For a[i] to be between 1 and 100