[Solved] I can’t catch InputMismatchException [closed]

[ad_1]

An exception is captured only if the statement that produce the exception is inside a try-catch statement.

You need to place int choosenCharacter=scan.nextInt(); inside the try block, and then the exception will be captured by the catch

[ad_2]

solved I can’t catch InputMismatchException [closed]