import java.util.Scanner; /** * Illustrates: * - Creating reference variables * - Using the dot operator * * @author alchambers * @version 2015 */ public class Echo { public static void main(String[] args){ // Create a Scanner reference variable so we can read what // the user types at the keyboard Scanner in = new Scanner(System.in); // Prompt the user System.out.println("Type something:"); // Notice we create a String reference variable // to hold the text that the user typed String line = in.nextLine(); System.out.println(line); line = in.nextLine(); System.out.println(line); line = in.nextLine(); System.out.println(line); // Okay, that's enough System.out.println("Okay, I have to go now. Bye."); } }