Created
December 12, 2010 16:06
-
-
Save raws/738130 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
int input; | |
try { | |
input = in.nextInt(); | |
} catch (InputMismatchException e) { | |
System.out.println("You've provided bad input!"); | |
System.exit(1); | |
} | |
System.out.println("Thanks for your valid input!"); | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment