The problem you have is that you have two possible outcomes. Either you have a valid double or you don't. If you have a return value you need to check for you might forget to check or you have an if check for every value.
try {
double d = Double.parseDouble(input);
double d2 = Double.parseDouble(input2);
double d3 = Double.parseDouble(input3);
double d4 = Double.parseDouble(input4);
// all number are good.
} catch (NumberFormatException e) {
e.printStackTrace(); //prints error
}
or
double d, d2, d3, d4;
if (tryParseDouble(input)) {
d = parseDouble(input);
if (tryParseDouble(input2)) {
d2 = parseDouble(input2);
if (tryParseDouble(input3)) {
d3 = parseDouble(input3);
} else {
if (tryParseDouble(input4)) {
d4 = parseDouble(input4);
} else {
System.out.println("Cannot parse " + input4);
}
System.out.println("Cannot parse " + input3);
}
} else {
System.out.println("Cannot parse " + input2);
}
} else {
System.out.println("Cannot parse " + input);
}