Top "Java.util.scanner" questions

A simple text scanner in the JDK which can parse primitive types and strings using regular expressions.

Scanner vs. BufferedReader

As far I know, the two most common methods of reading character-based data from a file in Java is using …

java file-io java.util.scanner bufferedreader
How to use Scanner to accept only valid int as input

I'm trying to make a small program more robust and I need some help with that. Scanner kb = new Scanner(…

java validation java.util.scanner
How to read multiple Integer values from a single line of input in Java?

I am working on a program and I want to allow a user to enter multiple integers when prompted. I …

java input java.util.scanner
java.util.NoSuchElementException: No line found

I got an run time exception in my program while I am reading a file through a Scanner. java.util.…

java java.util.scanner
Read CSV with Scanner()

My csv is getting read into the System.out, but I've noticed that any text with a space gets moved …

java csv java.util.scanner
how to insert a new line character in a string to PrintStream then use a scanner to re-read the file

I have several classes designed to simulation a book catalog. I have a book class (isbn, title, etc...), a BookNode …

java java.util.scanner printstream
Scanner is never closed

I'm working on a game and I came across a little problem with my scanner. I'm getting a resource leak …

java java.util.scanner resource-leak
Read line with Scanner

EDIT for further readers: the problem was that my input file was corrupted. I don't understand what I'm doing wrong : …

java java.util.scanner readline
Scanner only reads first word instead of line

In my current program one method asks the user to enter the description of a product as a String input. …

java string java.util.scanner
Read next word in java

I have a text file that has following content: ac und accipio annehmen ad zu adeo hinzugehen ... I read the …

java java.util.scanner