import java.util.*; public class AddFourRobust { public static void main( String args[] ) { Scanner console = new Scanner( System.in ); System.out.print("Input an integer: "); if ( console.hasNextInt() ) { int userInput = console.nextInt(); System.out.println("\nFour more than your number is " + ( userInput + 4 ) ); } else { System.out.println("\nThat wasn’t an integer!"); } } }