What would happen in the following method in case of try..catched exception, that will throw an exception ? Notice the return 0; is it unreachable ?
public int calculateAmount(Data data, int coefficient){
try {
int price = 0;
// do something
price *= executeCalculation(data.getBase(), coefficient);
return price;
} catch (Exception ex) {
throw new IllegalArgumentException("some params aren't valid");
}
return 0; // is this unreacheable in case of exception ?
}