Exam 12: Inheritance
Exam 1: Introduction to Computers and Programming35 Questions
Exam 2: Input, Processing, and Output35 Questions
Exam 3: Simple functions34 Questions
Exam 4: Decision Structures and Boolean Logic35 Questions
Exam 5: Repetition Structures35 Questions
Exam 6: Value-Returning functions and Modules35 Questions
Exam 7: files and Exceptions35 Questions
Exam 8: Lists and Tuples35 Questions
Exam 9: More About Strings35 Questions
Exam 10: Dictionaries and Sets35 Questions
Exam 11: Classes and Object-Oriented Programming35 Questions
Exam 12: Inheritance35 Questions
Exam 13: Recursion35 Questions
Exam 14: GUI Programming35 Questions
Select questions type
A subclass may not override any method other than the __init__ method.
Free
(True/False)
4.8/5
(39)
Correct Answer:
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:
specialized
Of the two classes Cola and Soda, which would most likely be the subclass?
Free
(Multiple Choice)
5.0/5
(53)
Correct Answer:
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)
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 superclass inherits attributes and methods from its subclasses without any of them having to be rewritten.
(True/False)
4.8/5
(39)
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
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)