Exam 6: Inheritance and Abstract Classes

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

What is one of the primary purposes of using inheritance?

(Multiple Choice)
4.8/5
(33)

A class that uses lists can use the methods defined in the AbstractCollection class.

(True/False)
4.9/5
(41)

An instance variable that refers to an integer in two different related classes is a likely candidate to be moved to an abstract class.

(True/False)
4.7/5
(37)

When creating the AbstractCollection class, which methods must you modify to provide default behavior?

(Multiple Choice)
4.8/5
(33)

In which situation is a search unnecessary when performing the add method on a sorted bag?

(Multiple Choice)
4.8/5
(35)

A class that inherits properties from another class is called a superclass.

(True/False)
5.0/5
(29)

When a programmer calls the next function on an iterator object, what happens if there is no current item in the sequence?

(Multiple Choice)
4.8/5
(35)

When implementing the __init__ method in the AbstractBag class, what task should you leave out because it is the responsibility of the subclasses?

(Multiple Choice)
4.8/5
(31)

How is creating a subclass of an existing class different from copying the code from the existing class to a new file?

(Multiple Choice)
4.8/5
(42)

Which of the following is true about abstract classes?

(Multiple Choice)
4.9/5
(32)
Showing 41 - 50 of 50
close modal

Filters

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