The Scanner class was implemented in Java 5.0 to make getting input easier:
Scanner input = new Scanner(System.in) the System.in will allow for console input.
Scanner sc = new Scanner(System.in);
int i = sc.nextInt();
/* will wait for input then assign it to the variable,
* in this case it will wait for an int.
*/
System.out.println(i); // will print the variable
https://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html