Courses
Tutorials
Practice
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
38.9K+ articles
DSA
22.5K+ articles
Python
20.5K+ articles
Experiences
16.6K+ articles
Java
10.5K+ articles
Java-Functions
4.1K+ articles
Difference Between
3.6K+ articles
Java - util package
1.5K+ articles
Java-I/O
75+ articles
Input and Output
20+ articles
Java-Scanner
15 posts
Recent Articles
Popular Articles
Difference between next() and nextLine() methods in Java
Last Updated: 27 December 2021
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 way to read input in a Jav...
read more
Java
Input and Output
Difference Between
Java-Scanner
Why is Scanner skipping nextLine() after use of other next functions?
Last Updated: 02 September 2021
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 of the c...
read more
Java
Java-Scanner
Scanner ioException() method in Java with Examples
Last Updated: 16 October 2018
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 exceptio...
read more
Java
Java - util package
Java-Functions
Java-Scanner
Scanner match() method in Java with Example
Last Updated: 16 October 2018
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 V...
read more
Java
Java - util package
Java-Functions
Java-Scanner
Scanner hasNextLine() method in Java with Examples
Last Updated: 16 October 2018
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 for input. The ...
read more
Java
Java - util package
Java-Functions
Java-Scanner
Scanner hasNextFloat() method in Java with Examples
Last Updated: 16 October 2018
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() method. The...
read more
Java
Java - util package
Java-Functions
Java-Scanner
Scanner hasNextDouble() method in Java with Examples
Last Updated: 16 October 2018
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() method. ...
read more
Java
Java - util package
Java-Functions
Java-Scanner
Scanner hasNextBoolean() method in Java with Examples
Last Updated: 16 October 2018
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() metho...
read more
Java
Java - util package
Java-Functions
Java-Scanner
Scanner hasNextBigDecimal() method in Java with Examples
Last Updated: 16 October 2018
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 nextBigDecima...
read more
Java
Java - util package
Java-Functions
Java-Scanner
Scanner hasNextBigInteger() method in Java with Examples
Last Updated: 17 November 2022
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 given radix. T...
read more
Java
Java - util package
Java-Functions
Java-Scanner
Scanner hasNextInt() method in Java with Examples
Last Updated: 17 November 2022
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 given radix. The scanner doe...
read more
Java
Java - util package
Java-Functions
Java-Scanner
Scanner hasNextByte() method in Java with Examples
Last Updated: 17 November 2022
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 given radix. The scanner d...
read more
Java
Java - util package
Java-Functions
Java-Scanner
Scanner hasNextLong() method in Java with Examples
Last Updated: 17 November 2022
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 given radix. The scanner d...
read more
Java
Java - util package
Java-Functions
Java-Scanner
Scanner hasNextShort() method in Java with Examples
Last Updated: 17 November 2022
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 given radix. The scanner...
read more
Java
Java - util package
Java-Functions
Java-Scanner
Scanner Class in Java
Last Updated: 11 April 2025
In Java, the Scanner class is present in the java.util package is used to obtain input for primitive types like int, double, etc., and strings. We can use this class to re...
read more
Java
Java-I/O
Java-Scanner
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !