D
Daniel Billingsley
Suppose I have a method that returns some type of object, and in that method
I have a try...catch block and just throw my own exception when I catch one.
The compiler insists that all code paths return a value, so...
do I just put
return null;
after I throw my exception in the catch block?
or should I initialize the local variable to null and return it in a finally
block?
or something else entirely, or is it just personal taste?
Thanks.
I have a try...catch block and just throw my own exception when I catch one.
The compiler insists that all code paths return a value, so...
do I just put
return null;
after I throw my exception in the catch block?
or should I initialize the local variable to null and return it in a finally
block?
or something else entirely, or is it just personal taste?
Thanks.