by
39 8
1
3
1,694
0
Top 1% !
Famous
Specified
Popularity: 12142nd place
Created
Modified Jan 31, 2017
This snippet is Public
No tags for this snippet yet.
Languagejava
LicenseMIT_X11

Using Scanner to Read System Inputs - Java Stdin and Stdout

Using Scanner to Read System Inputs - Java Stdin and Stdout
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/1653157/Using-Scanner-to-Read-System-Inputs---Ja?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
import java.util.*; Scanner scanner = new Scanner(System.in); String myString = scanner.next(); int myInt = scanner.nextInt(); scanner.close(); System.out.println("myString is: " + myString); System.out.println("myInt is: " + myInt);
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus