CS160 Final Exam Questions With
Correct Answers
The data stored in an object are commonly called _____. - CORRECT
| | | | | | | | | | | |
ANSWER✔✔-fields
The operations that an object can perform are called _____. - CORRECT
| | | | | | | | | | | |
ANSWER✔✔-methods
A _____ is a code that describes a particular type of object. (i.e. blueprint) -
| | | | | | | | | | | | | | |
CORRECT ANSWER✔✔-class |
Each object that is created from a class is called an _____ of the class. - CORRECT
| | | | | | | | | | | | | | | | |
ANSWER✔✔-instance
It provides a set of standard diagrams for graphically depicting object-oriented
| | | | | | | | | | |
systems. - CORRECT ANSWER✔✔-UML (Unified Modeling Language)
| | | | | |
An _____ indicates how the class may be accessed. - CORRECT ANSWER✔✔-
| | | | | | | | | | |
access specifier |
The fields and methods that belong to a class are referred to as the class's _____.
| | | | | | | | | | | | | | |
- CORRECT ANSWER✔✔-members
| | |
, When a method is designed to work on an instance of a class, it is referred to as
| | | | | | | | | | | | | | | | | |
an _____, and you do not write the word static in the header. - CORRECT
| | | | | | | | | | | | | | |
ANSWER✔✔-instance method |
A method that gets a value from a class's field but does not change it is known as
| | | | | | | | | | | | | | | | | |
an _____. - CORRECT ANSWER✔✔-accessor method
| | | | |
A method that stores a value in a field or changes the value of a field in some
| | | | | | | | | | | | | | | | | |
other way is known as a _____. - CORRECT ANSWER✔✔-mutator method
| | | | | | | | | |
_____ is an important concept in object-oriented programming. (Make the fields
| | | | | | | | | | |
private but the methods can remain public) - CORRECT ANSWER✔✔-data hiding
| | | | | | | | | |
When the value of an item is dependent on other data and that item is not
| | | | | | | | | | | | | | | |
updated when the other data is changed, it is said that the item has become
| | | | | | | | | | | | | | |
_____. - CORRECT ANSWER✔✔-stale
| | |
Each instance of a class has its own set of fields, which are known as _____. -
| | | | | | | | | | | | | | | | |
CORRECT ANSWER✔✔-instance fields | |
A _____ is a method that is automatically called when an object is created. -
| | | | | | | | | | | | | | |
CORRECT ANSWER✔✔-constructor |
A variable that does not yet hold an object's address is called an _____. -
| | | | | | | | | | | | | | |
CORRECT ANSWER✔✔-uninitialized reference variable
| | |
Correct Answers
The data stored in an object are commonly called _____. - CORRECT
| | | | | | | | | | | |
ANSWER✔✔-fields
The operations that an object can perform are called _____. - CORRECT
| | | | | | | | | | | |
ANSWER✔✔-methods
A _____ is a code that describes a particular type of object. (i.e. blueprint) -
| | | | | | | | | | | | | | |
CORRECT ANSWER✔✔-class |
Each object that is created from a class is called an _____ of the class. - CORRECT
| | | | | | | | | | | | | | | | |
ANSWER✔✔-instance
It provides a set of standard diagrams for graphically depicting object-oriented
| | | | | | | | | | |
systems. - CORRECT ANSWER✔✔-UML (Unified Modeling Language)
| | | | | |
An _____ indicates how the class may be accessed. - CORRECT ANSWER✔✔-
| | | | | | | | | | |
access specifier |
The fields and methods that belong to a class are referred to as the class's _____.
| | | | | | | | | | | | | | |
- CORRECT ANSWER✔✔-members
| | |
, When a method is designed to work on an instance of a class, it is referred to as
| | | | | | | | | | | | | | | | | |
an _____, and you do not write the word static in the header. - CORRECT
| | | | | | | | | | | | | | |
ANSWER✔✔-instance method |
A method that gets a value from a class's field but does not change it is known as
| | | | | | | | | | | | | | | | | |
an _____. - CORRECT ANSWER✔✔-accessor method
| | | | |
A method that stores a value in a field or changes the value of a field in some
| | | | | | | | | | | | | | | | | |
other way is known as a _____. - CORRECT ANSWER✔✔-mutator method
| | | | | | | | | |
_____ is an important concept in object-oriented programming. (Make the fields
| | | | | | | | | | |
private but the methods can remain public) - CORRECT ANSWER✔✔-data hiding
| | | | | | | | | |
When the value of an item is dependent on other data and that item is not
| | | | | | | | | | | | | | | |
updated when the other data is changed, it is said that the item has become
| | | | | | | | | | | | | | |
_____. - CORRECT ANSWER✔✔-stale
| | |
Each instance of a class has its own set of fields, which are known as _____. -
| | | | | | | | | | | | | | | | |
CORRECT ANSWER✔✔-instance fields | |
A _____ is a method that is automatically called when an object is created. -
| | | | | | | | | | | | | | |
CORRECT ANSWER✔✔-constructor |
A variable that does not yet hold an object's address is called an _____. -
| | | | | | | | | | | | | | |
CORRECT ANSWER✔✔-uninitialized reference variable
| | |