Chapter 9 Flashcards
Accessor/getter
Is a method that allows a client to retrieve a data field
action/behavior
An action that can be called by an object
anonymous object
An object created without being assigned to a reference variable
attribute/data field/property
A variable that stores a value for an object
class
An encapsulated collection of data and methods that operate on data. A class may be instantiated to create an object that is an instance of the class.
class’s variable
Refers to the variables declared in the class.
client
Refers to the program that uses a class. The program is known as a client of the class
constructor
A special method for initializing objects when creating objects using the new operator. The constructor has exactly the same name as its defining class. Constructors can be overloaded, making it easier to construct objects with different initial data values.
data field encapsulation
To prevent direct modifications of properties through the object reference, you can declare the field private, using the private modifier. Data field encapsulation makes the class easy to maintain.
default constructor
If a class does not define any constructors explicitly, a no-arg constructor with empty body is assumed. This is called a default constructor.
dot operator
(.) An operator used to access members of an object. If the member is static, it can be accessed through the class name using the dot operator.
immutable class
A class is immutable if it contains all private data fields and no mutator methods and no accessor methods that would return a reference to a mutable data field object.
immutable object
An object of an immutable class.
instantiation
The process of creating an object of a class.
mutator/setter
Allows a client to modify a data field.
no-argument constructor
A constructor without arguments
null value
A literal of a reference variable that does not reference any concrete object.
object
Can be created from a class using the class’s constructor.
object-oriented programming
(OOP)
package-private/package-access
If public or private is not used, then by default the classes, methods, and data are accessible by any class in the same package. THis is known as package-private or package-access.
private constructor
A private constructor prevents constructing objects from the class
public class
The public visibility modifier is used for the class.
reference type
A data type that is a class or an interface.
reference variable
A variable of a class type.
state
The state of an object is described by attributes of the object.
static method
A method that can be invoked without creating an instance of the class. TO define static methods, put the modifier static in the method declaration.
static variable
A data member declared using the static modifier. A static variable is shared by all instances of that class. Static variables are used to communicate between different objects of the same class and to handle global states among these objects.
this keyword
Refers to the object itself.
Unified Modeling Language
(UML) A graphical notation for describing classes and their relationships.