Exam 12: Inheritance

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

A subclass may not override any method other than the __init__ method.

Free
(True/False)
4.8/5
(39)
Correct Answer:
Verified

False

New attributes and methods may be added to a subclass, which makes it a(n) _______________ version of the superclass.

Free
(Short Answer)
4.8/5
(37)
Correct Answer:
Verified

specialized

Of the two classes Cola and Soda, which would most likely be the subclass?

Free
(Multiple Choice)
5.0/5
(53)
Correct Answer:
Verified

A

When a subclass method has the same name as a superclass method, it is often said that the subclass method _______________ the superclass method.

(Short Answer)
4.9/5
(33)

In the following line of code, what is the name of the subclass? class Rose(flower):

(Multiple Choice)
4.9/5
(38)

One of the ingredients of polymorphic behavior is the ability to define a method in a subclass, and then define a method with the same name in a superclass.

(True/False)
4.9/5
(42)

In a UML diagram, what does the open arrowhead point to?

(Multiple Choice)
4.9/5
(29)

Which method can you use to determine whether an object is an instance of a class?

(Multiple Choice)
4.7/5
(33)

In an inheritance relationship, what is a specialized class called?

(Multiple Choice)
5.0/5
(38)

Examine the following piece of code: class Potato (Vegetable): In a UML diagram, what would the open arrowhead point to?

(Multiple Choice)
4.8/5
(33)

In the following line of code, what is the name of the base class? class Male(Human):

(Multiple Choice)
4.8/5
(38)

When there are several classes that have many common data attributes, it is better to write a(n) _____ to hold all the general data.

(Multiple Choice)
4.8/5
(30)

A subclass is also called a(n) _______________ class.

(Short Answer)
4.7/5
(42)

A superclass inherits attributes and methods from its subclasses without any of them having to be rewritten.

(True/False)
4.8/5
(39)

What does a subclass inherit from a superclass?

(Multiple Choice)
4.9/5
(43)

In an inheritance relationship, the extended class is called the _______________.

(Short Answer)
4.9/5
(44)

What gives a program the ability to call the correct method depending on the type of object that is used to call it?

(Multiple Choice)
4.9/5
(31)

In a UML diagram depicting inheritance, you only write the name of the subclass.

(True/False)
4.9/5
(35)

In an inheritance relationship, a television is a(n) _______________ of the electronics class.

(Short Answer)
4.8/5
(45)

Which of the following is the correct syntax for defining a class dining which inherits from class furniture?

(Multiple Choice)
4.7/5
(38)
Showing 1 - 20 of 35
close modal

Filters

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