everyone. I have a rookie question about the returning value in java. Here\'s my code.
@Override
public long addDrugTreatment(long id, String diagnosis, Stri
In Java (or any other C-like language) all control paths must return a value.
If an exception is thrown inside the try then the return will not be executed and so you are not returning a value on all possible control paths.
You have to either:
return after the try-catch orreturn inside each catch orfinally with a return.