My friend does a bunch of Java work (commandline, still toying around) and I notice a bunch of try/catch blocks like this:
try {
double a = Double.parseDouble(secondInput);
}
catch(NumberFormatException nFE) {
System.out.println("The input was not an integer.");
try {
Thread.sleep(1997);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.exit(0);
}
Which, IMO doesn't look very pretty. And I'm wondering what the "better" way to write this code would be.