Character input is not working correctly

ERROR:
Exception in thread “main” java.util.NoSuchElementException
at java.util.Scanner.throwFor(Scanner.java:862)
at java.util.Scanner.next(Scanner.java:1371)
at Main.main(Main.java:35)

Please share the link to the code.
For taking character input through Scanner you need to do this:-
char c = sc.next().charAt(0);

If you don’t have any queries related to this doubt , please mark the doubt as resolved. Or if you have any problem related to this doubt then ask it.