Chapter 3 Flashcards
method
a program module that contains a series of statements that carry out a task
Invoke/call a method
execute it
client method
a method that calls another
Abstraction
The programming feature that allows you to use a method name to encapsulate a series of statements
Method header
The first line of the method and contains information about how other methods can interact with it
Declaration
Another name for a method header
method body
Set of statements between curly braces that follow the header and that carry out the method’s actions
Implementation
describes the actions that execute within a method, method body
Stub
A method that contains no statements, programmers create stubs as temporary placeholders during the program development process
Access modifier (another term)
Access spesifier
return type
Indicates the type of data that is send back to its calling method ofter completion of the method
To return a call
is to send a call from a called method back to the calling method
A fully qualified identifier
Includes a class name and a dot before the identifier
Arguments
Are data items sent to methods in a method call
Parameters
Data items received by a method
Implementation hiding
Is a principle of object-oriented programming that describes the encapsulation of method details within a class
Interface to a method
includes the methods return type, name, arguments. Is the part that the client sees and uses
A black box
Device that you can use without understanding how it works
Local variable
Known only within the boundaries of a method
A methods signature
The combination of the method name and number, types and order of arguements
Actual parameters
Arguments in a method call
Formal parameters
The variables in a method declaration that accept the values from actual parameters
Return statement
ends a method and frequently sends a value from a called method back to the calling method
Method type
Its return type
Unreachable statements
those that cannot be executed because the logical path can never encounter them; an unreachable statement causes a compiler error
Dead code
Is a set of statements that are logically unreachable
is-a-relationship
Is the relationship between an object and the class of which it is a member
Instantiation of a class
Is an object; iow, it is one tangible example of a class
A class client /class user
Is an application or class that instantiates objects of another prewritten class
Data fields
Data variables declared in a class outside of any method
Instance variables
Data components of a class
Assigning private access to a field
No other classes can access the field’s values, and only methods of the same class are allowed to set, get, or otherwise use private variables
Information hiding
The object-oriented programming principle used when creating private access for data fields; a class’s private data can be changed or manipulated only by a class’s own methods and not by methods that belong to other classes
Mutator methods
Set values
Accessor methods
retrieve values
Non-static methods
those methods used with object instantiations are called instance methods
Primary key
is a unique identifier for data within a database
New operator
Allocates the memory needed to hold an object
Reference to an object
The name for a memory address where the object is held
Constructor
is a method that establishes an object
Default constructer
Is one that requires no parameters; if you do not write one, a default constructor is created for a class automatically by Java compiler
Abstract data type(ADT)
A type whose implementation is hidden and accessed through its public methods
Programmer-defined data type
One that is created by a programmer and not built into the language