This preview shows page 1. Sign up to view the full content.
Unformatted text preview: called, and each argument type must be the same as or narrower than the corresponding parameter type. A method call is executed as follows this is explained in more detail in a later lecture: 1. Create the parameters and local variables of the method being called. 2. Assign the values of the arguments to the corresponding parameters. 3. Execute the method body. 4. Erase the parameters and local variables and, if this is a function, return the value of the expression of the return-statement that terminated the method body. From the above, you can see that the arguments are evaluated once and their values are stored in the parameters. In the method body, storing a value in a parameter has no effect on the corresponding argument. 2005 Cornell University...
View Full Document
This note was uploaded on 07/07/2008 for the course CS 101 taught by Professor Gries during the Spring '08 term at Cornell University (Engineering School).
- Spring '08