// Declaring the Scanner built in class object to get input
Scanner stdin = new Scanner(System.in);
// this will flag the compiler that stdin is the variable that is used to get input
// through utility functions provided by the Scanner class
val = stdin.nextint();
// nextint() is the utility method of scanner class used to get input