Changes

Jump to navigation Jump to search
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.

Navigation menu