Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Java
(view source)
Revision as of 04:18, 26 March 2015
387 bytes added
,
04:18, 26 March 2015
no edit summary
Line 70:
Line 70:
System.out.println("value >= 20");
System.out.println("value >= 20");
}</source>
}</source>
+
== User Input
+
<source lang="java">
+
import java.util.Scanner;
+
+
public class UserInput {
+
public static void main(String[] args) {
+
Scanner myInput = new Scanner(System.in);
+
+
System.out.println("Enter a line of text: ");
+
String line = myInput.nextLine();
+
System.out.println("You entered: " + line);
+
}
+
}</source>
+
+
*Note: Ctrl + Shift + O in eclipse adds all the imports you need.
Rafahsolis
Bureaucrats
,
Administrators
2,306
edits
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
Variants
Views
Read
View source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
Special pages
Printable version