Top "Java.util.scanner" questions

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

How to read from standard input line by line?

What's the Scala recipe for reading line by line from the standard input ? Something like the equivalent java code : import …

java scala io java.util.scanner
Multiple delimiters in Scanner class of Java

How do I use the useDelimiter() method of the Scanner class to use both the comma (,) and the new line …

java delimiter java.util.scanner
Exception in thread "main" java.io.FileNotFoundException: Error

I am using Eclipse to compile and run my java codes. Here is Error I am getting. Exception in thread "…

java eclipse file-io exception-handling java.util.scanner
Java Scanner doesn't wait for user input

I am using Java's Scanner to read user input. If I use nextLine only once, it works OK. With two …

java io java.util.scanner
Scanner error with nextInt()

I am trying to use Scanner to get an int from the keyboard, but I getting the following error: Exception …

java java.util.scanner
how to read int,double,and sentence of string using same scanner variable

import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc=new Scanner(System.in); String …

java java.util.scanner
How to take a scanner object and make it a String

I need help doing the following: receiving input using Scanner class (I got this) taking input from scanner and making …

java string java.util.scanner replaceall
Scanner on text file hasNext() is infinite

I'm writing a simple program in Java and it requires reading data from a text file. However, I'm having trouble …

java java.util.scanner java-io
Is there an equivalent to the Scanner class in C# for strings?

In Java I can pass a Scanner a string and then I can do handy things like, scanner.hasNext() or …

c# java string java.util.scanner
Java: Infinite loop using Scanner in.hasNextInt()

I am using the following code: while (invalidInput) { // ask the user to specify a number to update the times by …

java loops java.util.scanner infinite