Chapter 6 Flashcards
actual parameter/argument
The variable or data to substitute formal parameters when invoking a method.
ambiguous invocation
There are two or more possible methods to match an invocation of a method, and neither is more specific than the other(s). Therefore, the invocation is ambiguous.
divide and conquer/stepwise refinement
The concept of method abstraction can be applied to the process of developing programs. When writing a large program, you can use the “divide and conquer” strategy to decompose it into subproblems. The subproblems can be further decomposed into smaller, more manageable problems.
formal parameter (i.e., parameter)
The variables defined in the method signature.
information hiding
A software engineering concept for hiding the detail implementation of a method for the client.
method
A collection of statements grouped together to perform an operation. See class method, instance method.
method abstraction
A technique in software development that hides detailed implementation. Method abstraction is defined as separating the use of a method from its implementation. The client can use a method without knowing how it is implemented. If you decide to change the implementation, the client program will not be affected.
method overloading
Method overloading means that you can define methods with the same name in a class as long as there is enough difference in their parameter profiles.
method signature
The combination of the name of a method and the list of its parameters.
modifier
A Java keyword that specifies the properties of data, methods, and classes and how they can be used. Examples of modifiers are public, private, and static.
parameter
A variable that is defined in the method header.
pass-by-value/call-by-value
A term used when a copy of the value of the argument is passed to the method. For a parameter of a primitive type, the actual value is passed; for a parameter of a reference type, the reference for the object is passed.
scope of a variable
Is the part of the program where the variable can be referenced.
stub
A simple, but not complete, version of the method. The use of stubs enables you to test invoking the method from a caller.
Main method
Is the starting method for executing a program.