Steps for attaching scanner
import java.util.*;
//OR
import java.util.Scanner; Scanner sc=new Scanner(System.in); boolean hasNextInt();
boolean hasNextByte();
boolean hasNextLong();
//and so on... int nextInt() throws InputMismatchException
double nextDouble() throws InputMismatchException
String next();
String nextLine();
boolean nextBoolean();
//and so on...Last updated