Scanner
suggest changeVersions
[{“Name”:“Java SE 5”,“GroupName”:null},{“Name”:“Java SE 6”,“GroupName”:null},{“Name”:“Java SE 7”,“GroupName”:null},{“Name”:“Java SE 8”,“GroupName”:null},{“Name”:“Java SE 9 (Early Access)”,“GroupName”:null}]
Syntax
- Scanner scanner = new Scanner(Source source);
- Scanner scanner = new Scanner(System.in);
Parameters
Parameter | Details |
——— | —–– |
Source | Source 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.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents