In order to read in data from the user via the keyboard we make use of the system in class called System.in. We can not simply use the System.in class though as we need to allow the user to enter the data the want to send before the program makes use of it. As a result we have to use to other Java classes called the InputStreamReader and BufferedReader to read in keyboard input.
These classes are in the set of Java classes called java.io and therefore need to be imported at the top of any Java program that makes use of them.
We can then make use of the classes to read in data from the keyboard.
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String input = br.readLine();