Home - Sairab/Learning-_JAVA GitHub Wiki

  1. 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.

  1. A Scanner breaks its input into tokens using a delimiter pattern, which by default matches whitespace.
  1. A scanning operation may block waiting for input.
  1. A Scanner is not safe for multithreaded use without external synchronization.
  1. Class declaration

Following is the declaration for java.util.Scanner class:

public final class Scanner extends Object implements Iterator<String>

  1. Class Methods
  1. delimiter()
  2. hasNext()
  3. nextInt()
  4. nextInt(int radix)
  5. nextLine()
  6. nextShort(int radix)
  7. radix()
  8. reset()
  9. skip(String pattern)
  10. useDelimiter(Pattern pattern)
  11. useDelimiter(String pattern)
  12. useRadix(int radix)

There are many classes used in java for consol input.

  1. lang
  1. math
  1. applet
  1. awt
  1. sql
  1. 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.

⚠️ **GitHub.com Fallback** ⚠️