The Scanner class in java.util package used for obtaining the input of the primitive types like int, double, etc. and strings. It is the easiest… Read More
Tag Archives: Java-Scanner
The nextLine() method of java.util.Scanner class advances this scanner past the current line and returns the input that was skipped. This function prints the rest… Read More
The ioException() method of java.util.Scanner class returns the IOException last thrown by this Scanner’s underlying Readable. This method returns null if no such exception exists.… Read More
The match() method of java.util.Scanner class returns the match result of the last scanning operation performed by this scanner. Syntax: public MatchResult match() Return Value:… Read More
The hasNextLine() method of java.util.Scanner class returns true if there is another line in the input of this scanner. This method may block while waiting… Read More
The hasNextFloat() method of java.util.Scanner class returns true if the next token in this scanner’s input can be interpreted as a Float using the nextFloat()… Read More
The hasNextDouble() method of java.util.Scanner class returns true if the next token in this scanner’s input can be interpreted as a Double using the nextDouble()… Read More
The hasNextBoolean() method of java.util.Scanner class returns true if the next token in this scanner’s input can be interpreted as a Boolean using the nextBoolean()… Read More
The hasNextBigDecimal() method of java.util.Scanner class returns true if the next token in this scanner’s input can be interpreted as a BigDecimal using the nextBigDecimal()… Read More
The hasNextBigInteger() method of java.util.Scanner class returns true if the next token in this scanner’s input can be assumed as a BigInteger value of the… Read More
The hasNextInt() method of java.util.Scanner class returns true if the next token in this scanner’s input can be assumed as a Int value of the… Read More
The hasNextByte() method of java.util.Scanner class returns true if the next token in this scanner’s input can be assumed as a Byte value of the… Read More
The hasNextLong() method of java.util.Scanner class returns true if the next token in this scanner’s input can be assumed as a Long value of the… Read More
The hasNextShort() method of java.util.Scanner class returns true if the next token in this scanner’s input can be assumed as a short value of the… Read More