java,io package contains BufferedReader class that can be used for taking input from console.

Java Code:
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String inputName = br.readLine();