Chapter 9 Flashcards

1
Q

Accessor/getter

A

Is a method that allows a client to retrieve a data field

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

action/behavior

A

An action that can be called by an object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

anonymous object

A

An object created without being assigned to a reference variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

attribute/data field/property

A

A variable that stores a value for an object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

class

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

class’s variable

A

Refers to the variables declared in the class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

client

A

Refers to the program that uses a class. The program is known as a client of the class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

constructor

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

data field encapsulation

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

default constructor

A

If a class does not define any constructors explicitly, a no-arg constructor with empty body is assumed. This is called a default constructor.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

dot operator

A

(.) 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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

immutable class

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

immutable object

A

An object of an immutable class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

instantiation

A

The process of creating an object of a class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

mutator/setter

A

Allows a client to modify a data field.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

no-argument constructor

A

A constructor without arguments

17
Q

null value

A

A literal of a reference variable that does not reference any concrete object.

18
Q

object

A

Can be created from a class using the class’s constructor.

19
Q

object-oriented programming

20
Q

package-private/package-access

A

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.

21
Q

private constructor

A

A private constructor prevents constructing objects from the class

22
Q

public class

A

The public visibility modifier is used for the class.

23
Q

reference type

A

A data type that is a class or an interface.

24
Q

reference variable

A

A variable of a class type.

25
Q

state

A

The state of an object is described by attributes of the object.

26
Q

static method

A

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.

27
Q

static variable

A

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.

28
Q

this keyword

A

Refers to the object itself.

29
Q

Unified Modeling Language

A

(UML) A graphical notation for describing classes and their relationships.