April 2013
Intermediate to advanced
1700 pages
92h 51m
English
In a world where method calls are one of the most essential ways to structure code, we need two core concepts: One is to call a method, using invocation syntax, as you saw when we discussed expressions; the other is a way to return from a method, transferring control back to the caller. Intimately related to this is the concept of a call stack as a means to keep track of who’s called what. Figure 7.29 shows the transitions of the call stack when making a method call and returning a result.
FIGURE 7.29 Illustrating the call stack.
The return statement has two forms. When used in a procedure—a method that returns the magical ...
Read now
Unlock full access