Home >Java >Javagetting Started >How to input from keyboard in java
First of all, if java wants to receive keyboard input, it needs to use the Scanner class. To use the Scanner class, you need to import it in advance. (Recommended learning: java course)
##After importing the required classes, create a new Scanner Class object to use to receive input.
After the object is created, we can call the corresponding method of the object to extract data from it.
Note that we can extract input data from the same object multiple times in a row.
The above is the detailed content of How to input from keyboard in java. For more information, please follow other related articles on the PHP Chinese website!