// Scott DeRuiter 9/22/2002 // Input1.java // Input an integer, a string, and prints them out. // 7/15/2011 - Greenstein: Changed TextReader to Scanner import java.util.Scanner; public class Input1 { public static void main ( String [] args ) { Scanner console = new Scanner( System.in ); int num = 0; System.out.print( "Input an integer > " ); num = console.nextInt( ); console.nextLine(); String line = new String(""); System.out.print( "Input a string > " ); line = console.nextLine( ); System.out.println( "num = " + num ); System.out.println( "line = " + line ); } }