COP 3502 Chapter 6: Methods
Document Summary
In order for a value returning method to return a result, a return statement using keyword return is required within the method body: use the keyword void when the method performs operations without returning a value, a return statement is not required in the body of a void method, but it can be used for terminating the method and returning to the method"s caller, two ways to call a method a. If a method returns void, a call to the method must be a statement: call stack, a call stack stores the activation records in a last in, first out fashion, when a method finishes its work and returns to its caller, its activation record is removed from the call stack, arguments/variables/parameters for a method, the arguments or variables passed to a method are not affected, regardless of the changes made to the parameter inside the method, the changes to the variables only exist within the scope of the method.