Home - Sairab/Learning-_JAVA GitHub Wiki
- Java.util.Scanner
Java.util.Scanner class is a simple text scanner which can parse primitive type and string using regular expressions. Following are important points about Scanner.
- A Scanner breaks its input into tokens using a delimiter pattern, which by default matches whitespace.
- A scanning operation may block waiting for input.
- A Scanner is not safe for multithreaded use without external synchronization.
- Class declaration
Following is the declaration for java.util.Scanner class:
public final class Scanner extends Object implements Iterator<String>
- Class Methods
- delimiter()
- hasNext()
- nextInt()
- nextInt(int radix)
- nextLine()
- nextShort(int radix)
- radix()
- reset()
- skip(String pattern)
- useDelimiter(Pattern pattern)
- useDelimiter(String pattern)
- useRadix(int radix)
There are many classes used in java for consol input.
- lang
- math
- applet
- awt
- sql
-
io
- Java.lang
It contain classes that are fundamental to the design of the java programming language.
- Java.io
It contain classes which provide the facility for system input and out put through data streams, serialization and the file system.
- Java.math
It contain classes which facilitate to perform mathematical operations like one of its class BitInteger contain methods likegcd,pow,subtract,mod,abs etc that makes programming more easier.
- Java.awt
It contains all classes for creating user interfaces and for painting graphics and images Some of its classes are :
- Graphics
- Java .applet
It contains all of the classes necessary to create an applet and the classes an applet uses to communicate with its applet context.