Using the return
keyword in Java code will return execution to the last piece of calling code in the call stack. If object foo
calls baz.bar()
, the return
keyword in the bar
method will continue code execution in foo
.
Let's say I have object foo
that calls foofoo
that calls foofoofoo
in the above scenario, and foofoofoo
calls baz.bar()
. Is there anyway in Java to use the return
keyword, or something else, so that the code in the bar
method can return all the way back up to foo
?
(WITHOUT THROWING AN EXCEPTION)