The return statement ends method execution and sends a value back to the caller. In void methods, return with no value exits early. In all other methods, return is required on every execution path.
return in void Methods
The return statement ends method execution and sends a value back to the caller. In void methods, return with no value exits early. In all other methods, return is required on every execution path.