Scanner is a class in java.util package used for obtaining the input of the primitive types like int, double etc. and strings. Using Scanner class we can enter the data at run time.The Java Scanner class breaks the input into tokens using a delimiter that is whitespace by default.