import java.util.*; public class GetSteakDecision { public static void main( String args[] ) { Scanner console = new Scanner( System.in ); System.out.print("Good evening, sir. True or False: You would like the steak? "); if ( console.hasNextBoolean() ) { boolean userWantsSteak = console.nextBoolean(); if (userWantsSteak) System.out.println("\nVery good, sir" ); else System.out.println("\nI'm afraid we have nothing else to offer"); } else { System.out.println("\nThat was not a boolean!"); } } }