Need help.

Why do I keep getting the same runtime error for all my codes? Can somebody help? For eg. I am getting the error:
Exception in thread “main” java.util.NoSuchElementException
at java.util.Scanner.throwFor(
at java.util.Scanner.nextInt(
at java.util.Scanner.nextInt(
at Life.main(
for the problem CHFAR. The link to my solution is I get the runtime error whenever I take input. Like in line 13 ‘int n= reader.nextInt();’.

//Your code
catch(Exception ex)
} error: class, interface, or enum expected
catch(Exception ex)
^ error: class, interface, or enum expected
2 errors
Got this compilation error.

Check your code link. You are sharing code of some HTML code submitted in Java.

Saw you got AC. Have you figured out the issue or you still need help?

I have figured out the issue. Thanks though. I might need help in the future. :slight_smile: