oOP Flashcards
are the variables that each object (each instance of a class) has as part of itself.
instance variables
means they are accessible only to the object itself.
private,
returns a reference to the object it constructs
constructor
Parameter names follow the same rules as the other names you might pick for a program. Names of this type are called
this
is a variable that holds part of the state of an object.
instance variable
In Java, a characteristic of a class that is not part of its objects
static.
Can the static main() method invoke other static methods of the class?
Yes. Static methods can call other static methods.
Will parameter passing be the same as with the instance methods of the previous chapters?
Yes. Static methods pass data to other static methods through parameters.
The program keeps looping until the user signals the end. What type of loop is this?
A sentinel controlled loop.
What is the parameter of the method that calculates factorial?
The value of N, an integer
What is the return value of the method that calculates factorial?
The factorial of N.
is an incomplete version of a method that is used in place of the full method. Extremely useful when developing programs.
stub
let you test individual methods. This can be very useful.
unit testing
is one whose data does not change.
immutable object
The arguments in a method call are often referred to as ____.
actual parameters
A(n) ____ method is a method that creates and initializes class objects.
constructor
____ is the encapsulation of method details within a class.
Implementation hiding
When a variable ceases to exist at the end of a method, programmers say the variable____.
goes out of scope
Method names that begin with “____” and “set” are very typical.
get
Public classes are accessible by all objects, which means that public classes can be
extend or/and used as a basis
Assigning ____to a field means that no other classes can access the field’s values.
private access
Methods used with object instantiations are called ____ methods.
instance
Methods that retrieve values are called ____ methods.
accessors
A(n) unique identifier is most likely used as a(n) ____ key in a database.
primary