// GameConsole.java (c) 2003 Kari Laitinen // www.naturalprogramming.com // 2004-10-11 File created. // 2004-10-11 Last modification. // This program shows how a method of class Console // can be used. class GameConsole { public static void main( String[] not_used ) { int integer_from_keyboard ; int one_larger_integer ; System.out.print( "\n This program is a computer game. Please, type in " + "\n an integer in the range 1 ... 2147483646 : " ) ; integer_from_keyboard = Console.readInt() ; one_larger_integer = integer_from_keyboard + 1 ; System.out.print( "\n You typed in " + integer_from_keyboard + "." + "\n My number is " + one_larger_integer + "." + "\n Sorry, you lost. I won. The game is over.\n") ; } }