try
{
n = s.nextLine();
a = s.nextInt();
}
catch(Exception e)
{
System.out.println("do u really want to come out? Write True or False");
boolean c = s.nextBoolean();
}
when i debug this code it does exactly what i want. but when i run it it doesnt let me do s.nextboolean(which s is an object of scanner(java.util.Scanner). i'm using it to get an input). what happens if that when the exception happens it prints do u really want to come out? Write True or False but then it prints the exception and crashes the code. it doesnt let me type True or False, it just crashes it.t in the code when it asks for an int and you give a string it should come out, so it gives a mismatch exception. is this a bug(i'm using intellij)