SCANNER CLASS
The scanner class is a utility class in the [Link] package. That allows programs to accept and process
easily. its most commonly used to take input from the key board
but it can also read from files, strings or other input sources, it can also help in reading and converting
data of various type without the need for complex parsing.
COMMONLY USED SCANNER METHOD
1. NEXT; this reads a single word until a space or new line.
2. NEXTLINE; this reads an entire line of text (including spaces) until the enter key is pressed
* NEXTlint; this reads an integer value
3. NEXT DOUBLE; this reads a floating point number
4. NEXT LONG; this reads a longer integer
5. NEXT BOOLEAN; this reads a boolean value (true/false)
6. HasNext; this returns true if another token available
7. HasNextln; this returns true if the next token can be read as an integer
8. HasNextDouble; this return true if the next can be read as a a double
9. HasNextLine; this checks if another line of text is available
10. CLOSE; this closes the scanner