Exam 10: Introduction to Inheritance

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags
Match each term with the correct statement below.
Premises:
Inherits from a base class
Responses:
class diagram
superclass
derived class
Correct Answer:
Verified
Premises:
Responses:
Inherits from a base class
class diagram
(Matching)
4.8/5
(39)
Match each term with the correct statement below.
Premises:
Makes a program run faster
Responses:
containment
inheritance
instanceof
Correct Answer:
Verified
Premises:
Responses:
Makes a program run faster
containment
(Matching)
4.9/5
(45)

Which of the following statements will create a class named Red that is based on the class Color ?

(Multiple Choice)
4.9/5
(40)

A class diagram consists of a rectangle divided into three sections.

(True/False)
4.9/5
(32)

What is information hiding and how is it used?

(Essay)
4.7/5
(37)

What are the parts of a class diagram and how would you use them?

(Essay)
4.9/5
(33)
Match each term with the correct statement below.
Premises:
Casting to a supertype
Responses:
containment
super()
upcast
Correct Answer:
Verified
Premises:
Responses:
Casting to a supertype
containment
(Matching)
4.8/5
(33)

When you create parent and child classes of your own, the child classes use ____ constructors.

(Multiple Choice)
4.8/5
(29)
Match each term with the correct statement below.
Premises:
Methods that work appropriately for subclasses of the same parent class
Responses:
subtype polymorphism
class diagram
super()
Correct Answer:
Verified
Premises:
Responses:
Methods that work appropriately for subclasses of the same parent class
subtype polymorphism
(Matching)
4.9/5
(34)
Match each term with the correct statement below.
Premises:
A mechanism that enables one class to assume both the behavior and the attributes of another class
Responses:
upcast
derived class
UML
Correct Answer:
Verified
Premises:
Responses:
A mechanism that enables one class to assume both the behavior and the attributes of another class
upcast
(Matching)
4.9/5
(32)

You can use the keyword ____ within a method in a derived class to access an overridden method in a base class.

(Multiple Choice)
4.7/5
(34)
Match each term with the correct statement below.
Premises:
An instance method call
Responses:
UML
inheritance
virtual method call
Correct Answer:
Verified
Premises:
Responses:
An instance method call
UML
(Matching)
4.9/5
(41)

How is the keyword protected used?

(Essay)
4.7/5
(47)
Match each term with the correct statement below.
Premises:
Must be the first statement in the subclass constructor
Responses:
subtype polymorphism
information hiding
UML
Correct Answer:
Verified
Premises:
Responses:
Must be the first statement in the subclass constructor
subtype polymorphism
(Matching)
4.8/5
(42)
Match each term with the correct statement below.
Premises:
Classes that directly use fields from parent classes
Responses:
UML
instanceof
inheritance
Correct Answer:
Verified
Premises:
Responses:
Classes that directly use fields from parent classes
UML
(Matching)
4.8/5
(35)

Arrows used in a ____ to show inheritance relationships extend from the descendant class and point to the original class.

(Multiple Choice)
4.9/5
(38)

The term ____ describes a "has a" relationship.

(Multiple Choice)
4.8/5
(31)

By convention, a class diagram contains the ____ following each attribute or method.

(Multiple Choice)
4.9/5
(28)

An advantage to making a method ____ is that the compiler knows there will be only one version of the method.

(Multiple Choice)
4.9/5
(34)

When you use the method name with a child object, the parent's version of the method is used.

(True/False)
5.0/5
(29)
Showing 21 - 40 of 78
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)