import java.util.Scanner; // needed for Scanner /** A Java program that demonstrates console based input and output. */ public class MyScanner { // Create a single shared Scanner for keyboard input private static Scanner scanner = new Scanner( System.in ); public static void main ( String [] args ) { // Prompt the user System.out.print( "Type some data for the program: " ); // Read a line of text from the user. String input = scanner.nextLine(); // Display the input back to the user. System.out.println( "input = " + input ); } }