Right, but I thought that it would then eventually reach the top of the while loop and then go back into the try statement.
I ended up adding sc.next(); in the catch statement and now all is...
Type: Posts; User: camel-man
Right, but I thought that it would then eventually reach the top of the while loop and then go back into the try statement.
I ended up adding sc.next(); in the catch statement and now all is...
Yes I tried a while loop like this, but whenever I enter in a double for example. It will go into an infinite loop saying "try again wrong type"
int i=0;
while(i<3)
{
try
{
...
Is there a method that allows me to check if the user entered anything other than an integer. For example I want the user only to enter an integer, I have this code.
try
{
...