
useRadix(int rad): The scanner’s default radix will be set to the mentioned radix.useDelimiter(String p): Delimiting pattern of the scanner will be set to the mentioned pattern made from the string p.useDelimiter(Pattern p): Delimiting pattern of the scanner will be set to the mentioned pattern.radix(): The default radix of the scanner will be returned.nextShort(): Input’s next token will be scanned as a short.nextShort(int rad): Input’s next token will be scanned as a short.nextLong(): Input’s next token will be scanned as a long.nextLong(int rad): Input’s next token will be scanned as a long.nextInt(int rad): Input’s next token will be scanned as an integer.nextInt(): Input’s next token will be scanned as an integer.nextFloat(): Input’s next token will be scanned as a float.nextDouble(): Input’s next token will be scanned as a double.nextByte(int rad): Input’s next token will be scanned as a byte.nextByte(): Input’s next token will be scanned as a byte.nextBoolean(): Input’s next token will be scanned as a Boolean, and it will be returned.nextBigInteger(int rad): Input’s next token will be scanned as a BigInteger.nextBigInteger(): Input’s next token will be scanned as a BigInteger.nextBigDecimal(): Input’s next token will be scanned as a BigDecimal.next(String p): Next token will be returned, which matches the mentioned pattern p made from the string p.next(Pattern p): Next token will be returned, which matches the mentioned pattern p.hasNext(String p): If the next token matches the mentioned pattern p made from the string p, true will be returned.hasNext(Pattern p): If the next token matches the mentioned pattern p, true will be returned.findWithinHorizon(String p, int horizon): Tries to identify the next occurrence of the mentioned pattern made from the string p, ignoring delimiters.hasNext(): If the scanner has another token in the input, true will be returned.findWithinHorizon(Pattern p, int horizon): Tries to identify the mentioned pattern’s next occurrence.delimiter(): Pattern that is currently used by the scanner to match delimiters will be returned.findInLine(String p): The next occurrence of the pattern that is made from the string will be attempted to find out, ignoring the delimiters.findInLine(Pattern p): Next occurrence of the mentioned pattern p will be attempted to find out, ignoring the delimiters.close(): Scanner gets closed on calling this method.Scanner(String src): A new scanner will be constructed that generates value from the mentioned string.įollowing are the methods that perform different functionalities.Scanner(ReadableByteChannel src, String charsetName): A new scanner will be constructed that generates value from the mentioned channel.Scanner(ReadableByteChannel src): A new scanner will be constructed that generates value from the mentioned channel.Scanner(Readable src): A new scanner will be constructed that generates value from the mentioned source.Scanner(Path src, String charsetName): A new scanner will be constructed that generates value from the mentioned file.Scanner(Path src): A new scanner will be constructed that generates value from the mentioned file.Scanner(InputStream src, String charsetName): A new scanner will be constructed that generates value from the mentioned input stream.

Scanner(InputStream src): A new scanner will be constructed that generates value from the mentioned input stream.Scanner(File src, String charsetName): A new scanner will be constructed that generates value scanned from the mentioned file.


The scanner class in Java has different constructors.

