Ok, so i'm migrating from C/C++ to Java, being quite unexpierienced in the latter. I am beginning to manage input given by the user. I know how to choose what kind of data to accept and which not, but i'd like to make some kind of loop that gives the user an opportunity to correct his mistake.
Here's a sample of what I used in C, and what I want to achieve here.
while (scanf("%i", &l)!=1 || (l<1 || l>100))
{
while (getchar()!='\n');
printf("\aDATA ERROR - Correct your inputn");
}
Anyone willing to help me achieve that?