I have the following code:
try {
double a = Double.parseDouble(args[0]);
if(a <= 1) {
...
System.exit(-1);
}
} catch(Exception e) {
...
System.exit(-1);
}
With my solutuion i have to write the same code twice. Is there a way to go to the catch block (like making an error on purpose) or is there another way to simplify this code?