I am getting underline in red color at my catch statement, not sure what is wrong the error that I am getting is ‘never thrown in body of a corresponding try statement’ what does it mean? everything looks fine to me.
public void validateTriangle(int sidea, int sideb, int sidec) throws InvalidValueException {
try {
if ((sidea + sideb > sidec) || (sideb + sidec > sidea) || (sidea + sidec > sideb)) {
findArea(side1, side2, side3);
}
} catch (InvalidValueException excep) {
message = excep.getMessage();
}
}
Check that
findAreaexplicitlythrows InvalidValueException