Java Language Scanner

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • Scanner scanner = new Scanner(Source source);
  • Scanner scanner = new Scanner(System.in);

Parameters

ParameterDetails
SourceSource could be either one of String, File or any kind of InputStream

Remarks

The Scanner class was introduced in Java 5. The reset() method was added in Java 6, and a couple of new constructors were added in Java 7 for interoperability with the (then) new Path interface.



Got any Java Language Question?