write a java statement to input a character from the user through keyboard
Answers
Answered by
0
Answer:
Accepting keyboard input in Java is done using a Scanner object.
Consider the following statement
- This statement declares a reference variable named console. The Scanner object is associated with standard input device (System.in).
- To get input from keyboard, you can call methods of Scanner class. For example in following statment nextInt() method of Scanner takes an
- integer and returns to variable x : int x = console.nextInt(); EXAMPLE :_
Similar questions