Deck 11: Inheritance

Full screen (f)
exit full mode
Question
The class at the highest level in a class diagram

A)is an abstract class.
B)points directly to all of its subclasses.
C)has definitions for all methods in the class hierarchy.
D)is the most general class in the class diagram.
Use Space or
up arrow
down arrow
to flip the card.
Question
Which of the following is not an example of a generalization/specialization relationship?

A)vehicle/car
B)furniture/chair
C)food/groceries
D)building/fire station
Question
Another name for a subclass is a(n)

A)described class.
B)inherited class.
C)derived class.
D) parent class.
Question
If two methods in a class hierarchy have the same name,
A)the classes that contain them cannot be included in the same program.

A)the method name must be appended to the class name on invokation.
B)one method must have fewer parameters than the other to ensure uniqueness.
D)an object name must precede the method name when either method is invoked.
Question
How is generalization/specialization represented on a UML class diagram?

A)a solid line.
B)an unfilled arrow.
C)a filled diamond.
D)a dashed line.
Question
A tennis player is a kind of athlete is an example of

A)generalization/specialization.
B)class hierarchy.
C)polymorphism.
D)inheritance.
Question
Inheritance is

A)a mechanism that uses generalization/specialization relationships.
B)a mechanism for relating classes and objects.
C)a relationship that establishes levels in a class hierarchy.
D)a mechanism to share identifications and descriptions.
Question
Inheritance takes advantage of an existing generalization/specialization relationship.
Question
Classes that are not abstract classes are sometimes referred to as

A)base classes.
B)concrete classes.
C)superclasses.
D)inherited classes.
Question
Which of the following people was not involved in the definition of UML?

A)Harlan Mills
B)Ivar Jacobson
C)Grady Booch
D)Jim Rumbaugh
Question
A subclass cannot contain a data member that is not in its base class.
Question
An abstract class

A)has at least one method that is identified but not defined.
B) is defined in each class in which it appears.
C)has no constructor method.
D)has at least one data member that is not referenced during processing.
Question
A polymorphic method

A)has multiple implementations within the same class definition.
B)is uniquely identified by the data types of its arguments.
C)can be used in a subclass if it's not used in a base class.
D)has the same name as another method within the same class hierarchy.
Question
A subclass can contain a new design of an inherited method.
Question
When two constructors are given in a class,they execute in sequence during processing.
Question
The process of reimplementing in a subclass a method from the base class is called

A)overriding.
B)overloading.
C)polymorphism.
D)inheritance.
Question
What is another name for an "is-a"relationship?

A)composition
B)abstraction
C)generalization/specialization
D)kind-of/example
Question
When a subclass is created,processing proceeds as if

A)the subclass was itself a base class.
B)a call to the constructor of the base class were the first statement in the constructor for the subclass.
C)the subclass was the class at the top of the class hierarchy.
D)a call to the subclass's constructor had already occurred.
Question
A base class may also be called a(n)

A)superclass.
B)subclass.
C)derived class.
D)existent class.
Question
A subclass cannot inherit methods from another class at its same level.
Question
Developers often use inheritance to simplify and shorten their implementation tasks.
Question
A class definition may include a constructor or a destructor,but will not reasonably include both.
Question
Polymorphism is used extensively in commercial programming.
Question
A single driver program may instantiate two or more instances of the same class.
Question
Structured programming control structures do not apply in designing a class when inheritance is used.
Question
No objects can be created of a base class that is an abstract class.
Question
A single method invocation may contain constants or variables,but not both.
Question
When two classes have a generalization/specialization relationship,the more specific class may contain additional information.
Question
A single method can return values that are of different data types.
Question
A method in a subclass can invoke a method in its base class.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/30
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 11: Inheritance
1
The class at the highest level in a class diagram

A)is an abstract class.
B)points directly to all of its subclasses.
C)has definitions for all methods in the class hierarchy.
D)is the most general class in the class diagram.
D
2
Which of the following is not an example of a generalization/specialization relationship?

A)vehicle/car
B)furniture/chair
C)food/groceries
D)building/fire station
C
3
Another name for a subclass is a(n)

A)described class.
B)inherited class.
C)derived class.
D) parent class.
C
4
If two methods in a class hierarchy have the same name,
A)the classes that contain them cannot be included in the same program.

A)the method name must be appended to the class name on invokation.
B)one method must have fewer parameters than the other to ensure uniqueness.
D)an object name must precede the method name when either method is invoked.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
5
How is generalization/specialization represented on a UML class diagram?

A)a solid line.
B)an unfilled arrow.
C)a filled diamond.
D)a dashed line.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
6
A tennis player is a kind of athlete is an example of

A)generalization/specialization.
B)class hierarchy.
C)polymorphism.
D)inheritance.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
7
Inheritance is

A)a mechanism that uses generalization/specialization relationships.
B)a mechanism for relating classes and objects.
C)a relationship that establishes levels in a class hierarchy.
D)a mechanism to share identifications and descriptions.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
8
Inheritance takes advantage of an existing generalization/specialization relationship.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
9
Classes that are not abstract classes are sometimes referred to as

A)base classes.
B)concrete classes.
C)superclasses.
D)inherited classes.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
10
Which of the following people was not involved in the definition of UML?

A)Harlan Mills
B)Ivar Jacobson
C)Grady Booch
D)Jim Rumbaugh
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
11
A subclass cannot contain a data member that is not in its base class.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
12
An abstract class

A)has at least one method that is identified but not defined.
B) is defined in each class in which it appears.
C)has no constructor method.
D)has at least one data member that is not referenced during processing.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
13
A polymorphic method

A)has multiple implementations within the same class definition.
B)is uniquely identified by the data types of its arguments.
C)can be used in a subclass if it's not used in a base class.
D)has the same name as another method within the same class hierarchy.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
14
A subclass can contain a new design of an inherited method.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
15
When two constructors are given in a class,they execute in sequence during processing.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
16
The process of reimplementing in a subclass a method from the base class is called

A)overriding.
B)overloading.
C)polymorphism.
D)inheritance.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
17
What is another name for an "is-a"relationship?

A)composition
B)abstraction
C)generalization/specialization
D)kind-of/example
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
18
When a subclass is created,processing proceeds as if

A)the subclass was itself a base class.
B)a call to the constructor of the base class were the first statement in the constructor for the subclass.
C)the subclass was the class at the top of the class hierarchy.
D)a call to the subclass's constructor had already occurred.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
19
A base class may also be called a(n)

A)superclass.
B)subclass.
C)derived class.
D)existent class.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
20
A subclass cannot inherit methods from another class at its same level.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
21
Developers often use inheritance to simplify and shorten their implementation tasks.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
22
A class definition may include a constructor or a destructor,but will not reasonably include both.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
23
Polymorphism is used extensively in commercial programming.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
24
A single driver program may instantiate two or more instances of the same class.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
25
Structured programming control structures do not apply in designing a class when inheritance is used.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
26
No objects can be created of a base class that is an abstract class.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
27
A single method invocation may contain constants or variables,but not both.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
28
When two classes have a generalization/specialization relationship,the more specific class may contain additional information.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
29
A single method can return values that are of different data types.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
30
A method in a subclass can invoke a method in its base class.
Unlock Deck
Unlock for access to all 30 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 30 flashcards in this deck.