M/F 2:30-3:20 |
CS 1130: Transition to OO Programming Spring 2016 |
Main
About: Overview Announcements Staff Consultants Calendar Materials: Texts DrJava Terminology Lectures: In-Class Web-Based VideoNote Assessment: Grading Assignments Labs Resources: CMS Piazza (link) Piazza (about) Java API Style Guide Academic Integrity |
Function and Procedure CallsA function call has the form
and a procedure call has the form
where <arguments> is a sequence of expressions separated by commas. The method call may have to be preceded by an expression that indicates where the method is. For example,
The number of arguments must equal the number of parameters of the method being 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:
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. |