Write down the syntax to input a character through scanner class with an example.
123 Likes
Syntax:
char <variable name> = <Scanner Object>.next().charAt(0);
Example:
Scanner in = new Scanner(System.in); char ch = in.next().charAt(0);
Answered By
73 Likes
What is the use of the keyword 'import' in Java programming?
What is a compound statement? Give an example.
What is a Runtime error? Explain with an example.
What are the different types of errors that take place during the execution of a program?