Deck 17: Object-Oriented Design

Full screen (f)
exit full mode
Question
An abstraction hides details. A good abstraction hides the right details at the right time so that we can manage __________.

A) Capacity
B) Time
C) Complexity
D) None of the above
Use Space or
up arrow
down arrow
to flip the card.
Question
Each _______ clause on a try statement handles a particular kind of exception that may be thrown within the try block.

A) Catch
B) Exception
C) Throw
D) None of the above
Question
The versions of an overloaded method are distinguished by their ___________. The number, type, or order of their parameters must be distinct.

A) Signatures
B) Headers
C) Documentation
D) None of the above
Question
A _______ is a blueprint for an object; it reserves no memory space for data. Each object has its own data space, and thus its own state.

A) Class
B) Object
C) UML
D) None of the above
Question
The ________ of a variable, which determines where it can be referenced, depends on where it is declared.

A) Type
B) Value
C) Scope
D) None of the above
Question
Several references can refer to the same object. These references are ________ of each other.

A) Copies
B) Aliases
C) Siblings
D) None of the above
Question
The toString and equals methods are defined in the Object class and therefore are ________ by every class in every Java program.

A) Inherited
B) Copied
C) Ignored
D) None of the above
Question
Visibility modifiers determine which variables and methods are inherited. ___________ visibility provides the best possible encapsulation that permits inheritance.

A) Public
B) Private
C) Protected
D) None of the above
Question
A child class can _________ (redefine) the parent's definition of an inherited method.

A) Override
B) Overload
C) Implement
D) None of the above
Question
A class derived from an abstract parent must __________ all of its parent's abstract methods, or the derived class will also be considered abstract.

A) Use
B) Copy
C) Override
D) Overload
Question
A reference variable can refer to any object created from any class related to it by ___________.

A) Reference
B) Value
C) Inheritance
D) None of the above
Question
A ______ is a Java language element used to group related classes under a common name.
Question
Each object has a ____ and a set of ____.
Question
An object reference variable stores the ______ of an object.
Question
The reserved word ______ represents a reference that does not point to a valid object.
Question
A variable declared in a method is ______ to that method and cannot be used outside of it.
Question
The ______ operator compares object references for equality, returning true if the references are aliases of each other.
Question
The ______ method can be defined to determine equality between objects in any way we consider appropriate.
Question
If an object has no references to it, a program cannot use it. Java performs ______ by periodically reclaiming the memory space occupied by these objects.
Question
A ______ class represents a primitive value so that it can be treated as an object.
Question
A parent's constructor can be invoked using the ______ reference.
Question
The child of one class can be the parent of one or more other classes, creating a class ______.
Question
All Java classes are derived, directly or indirectly, from the ______ class.
Question
An ______ class cannot be instantiated. It represents a concept on which other classes can build their definitions.
Question
A ______ reference can refer to different types of objects over time.
Question
Interfaces allow us to make ______ references, in which the method that is invoked is based on the particular object being referenced at the time.
Question
The messages printed by a thrown exception indicate the nature of the problem and provide a ______.
Question
If an exception is not caught and handled where it occurs, it is ______ to the calling method.
Question
The new operator returns a reference to a newly created object.
Question
The values of an object's variables define its behavior. The methods to which an object responds define its state.
Question
Objects should be encapsulated. The rest of a program should interact with an object only through a well-defined interface.
Question
Instance variables should be declared with public visibility to promote encapsulation.
Question
A constructor cannot have any return type, even void.
Question
The this reference always refers to the currently executing object.
Question
When an object is passed to a method, the actual and formal parameters become aliases of each other.
Question
A method is made static by using the static modifier in the method
declaration.
Question
Inherited variables and methods can be used in the derived class as if they had been declared locally.
Question
An interface is a collection of abstract methods. It cannot be instantiated.
Question
Common features should be located as low in a class hierarchy as is reasonable, minimizing maintenance efforts.
Question
Inheritance can be applied to interfaces, so that one interface can be derived from another interface.
Question
A polymorphic reference uses the type of the reference, not the type of the object, to determine which version of a method to invoke.
Question
Errors and exceptions represent unusual or invalid processing.
Question
Objects should be self-governing. Explain.
Question
Describe each of the following:
a. public method
b. private method
c. public variable
d. private variable
Question
What are constructors used for? How are they defined?
Question
How are overloaded methods distinguished from each other?
Question
What is an aggregate object?
Question
What is the difference between a static variable and an instance variable?
Question
What is the difference between a class and an interface?
Question
Describe the relationship between a parent class and a child class.
Question
What relationship should every class derivation represent?
Question
What is the significance of the Object class?
Question
How is overriding related to polymorphism?
Question
How can polymorphism be accomplished using interfaces?
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/54
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 17: Object-Oriented Design
1
An abstraction hides details. A good abstraction hides the right details at the right time so that we can manage __________.

A) Capacity
B) Time
C) Complexity
D) None of the above
Complexity
2
Each _______ clause on a try statement handles a particular kind of exception that may be thrown within the try block.

A) Catch
B) Exception
C) Throw
D) None of the above
Catch
3
The versions of an overloaded method are distinguished by their ___________. The number, type, or order of their parameters must be distinct.

A) Signatures
B) Headers
C) Documentation
D) None of the above
Signatures
4
A _______ is a blueprint for an object; it reserves no memory space for data. Each object has its own data space, and thus its own state.

A) Class
B) Object
C) UML
D) None of the above
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
5
The ________ of a variable, which determines where it can be referenced, depends on where it is declared.

A) Type
B) Value
C) Scope
D) None of the above
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
6
Several references can refer to the same object. These references are ________ of each other.

A) Copies
B) Aliases
C) Siblings
D) None of the above
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
7
The toString and equals methods are defined in the Object class and therefore are ________ by every class in every Java program.

A) Inherited
B) Copied
C) Ignored
D) None of the above
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
8
Visibility modifiers determine which variables and methods are inherited. ___________ visibility provides the best possible encapsulation that permits inheritance.

A) Public
B) Private
C) Protected
D) None of the above
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
9
A child class can _________ (redefine) the parent's definition of an inherited method.

A) Override
B) Overload
C) Implement
D) None of the above
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
10
A class derived from an abstract parent must __________ all of its parent's abstract methods, or the derived class will also be considered abstract.

A) Use
B) Copy
C) Override
D) Overload
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
11
A reference variable can refer to any object created from any class related to it by ___________.

A) Reference
B) Value
C) Inheritance
D) None of the above
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
12
A ______ is a Java language element used to group related classes under a common name.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
13
Each object has a ____ and a set of ____.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
14
An object reference variable stores the ______ of an object.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
15
The reserved word ______ represents a reference that does not point to a valid object.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
16
A variable declared in a method is ______ to that method and cannot be used outside of it.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
17
The ______ operator compares object references for equality, returning true if the references are aliases of each other.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
18
The ______ method can be defined to determine equality between objects in any way we consider appropriate.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
19
If an object has no references to it, a program cannot use it. Java performs ______ by periodically reclaiming the memory space occupied by these objects.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
20
A ______ class represents a primitive value so that it can be treated as an object.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
21
A parent's constructor can be invoked using the ______ reference.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
22
The child of one class can be the parent of one or more other classes, creating a class ______.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
23
All Java classes are derived, directly or indirectly, from the ______ class.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
24
An ______ class cannot be instantiated. It represents a concept on which other classes can build their definitions.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
25
A ______ reference can refer to different types of objects over time.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
26
Interfaces allow us to make ______ references, in which the method that is invoked is based on the particular object being referenced at the time.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
27
The messages printed by a thrown exception indicate the nature of the problem and provide a ______.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
28
If an exception is not caught and handled where it occurs, it is ______ to the calling method.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
29
The new operator returns a reference to a newly created object.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
30
The values of an object's variables define its behavior. The methods to which an object responds define its state.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
31
Objects should be encapsulated. The rest of a program should interact with an object only through a well-defined interface.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
32
Instance variables should be declared with public visibility to promote encapsulation.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
33
A constructor cannot have any return type, even void.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
34
The this reference always refers to the currently executing object.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
35
When an object is passed to a method, the actual and formal parameters become aliases of each other.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
36
A method is made static by using the static modifier in the method
declaration.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
37
Inherited variables and methods can be used in the derived class as if they had been declared locally.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
38
An interface is a collection of abstract methods. It cannot be instantiated.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
39
Common features should be located as low in a class hierarchy as is reasonable, minimizing maintenance efforts.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
40
Inheritance can be applied to interfaces, so that one interface can be derived from another interface.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
41
A polymorphic reference uses the type of the reference, not the type of the object, to determine which version of a method to invoke.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
42
Errors and exceptions represent unusual or invalid processing.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
43
Objects should be self-governing. Explain.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
44
Describe each of the following:
a. public method
b. private method
c. public variable
d. private variable
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
45
What are constructors used for? How are they defined?
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
46
How are overloaded methods distinguished from each other?
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
47
What is an aggregate object?
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
48
What is the difference between a static variable and an instance variable?
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
49
What is the difference between a class and an interface?
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
50
Describe the relationship between a parent class and a child class.
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
51
What relationship should every class derivation represent?
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
52
What is the significance of the Object class?
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
53
How is overriding related to polymorphism?
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
54
How can polymorphism be accomplished using interfaces?
Unlock Deck
Unlock for access to all 54 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 54 flashcards in this deck.