zuai-logo
zuai-logo
  1. AP Computer Science A
FlashcardFlashcardStudy GuideStudy GuideQuestion BankQuestion Bank
GlossaryGlossary

Inheritance in Object-Oriented Programming

Question 1
college-boardComputer Science AAPExam Style
1 mark

What is commonly used in object-oriented programming to ensure derived class methods behave correctly?

Question 2
college-boardComputer Science AAPExam Style
1 mark

Assuming multiple inheritance is allowed and classes FlyingObject and Watercraft both have a default void method named 'activate', which implementation will be inherited in class 'Seaplane' without explicit override, given that 'Seaplane' extends both?

Question 3
college-boardComputer Science AAPExam Style
1 mark

Given an unsorted array, which algorithm would not be recommended if you need to prioritize memory efficiency and the input size is large?

Question 4
college-boardComputer Science AAPExam Style
1 mark

Which principle is best demonstrated when an array of type Animal contains elements like Dog, Cat, and Bird that all extend from Animal?

Question 5
college-boardComputer Science AAPExam Style
1 mark

After successfully instantiating an object with 'new', what must always be followed by this expression?

Question 6
college-boardComputer Science AAPExam Style
1 mark

Given a base class Animal and derived classes Mammal, Bird, and Fish, which instantiation correctly demonstrates polymorphism?

Question 7
college-boardComputer Science AAPExam Style
1 mark

If Class C is a superclass of Class B and a subclass of Class A, which of the following is NOT valid?

Feedback stars icon

How are we doing?

Give us your feedback and let us know how we can improve

Question 8
college-boardComputer Science AAPExam Style
1 mark

When designing software that includes classes representing different kinds of bank accounts like SavingsAccount and CheckingAccount derived from Account, why might you make Account an abstract class rather than concrete?

Question 9
college-boardComputer Science AAPExam Style
1 mark

If Class J is a superclass of Class K and Class L, which of the following are valid?

Question 10
college-boardComputer Science AAPExam Style
1 mark

If class I extends class H, and class P extends class I, what is the direct superclass of class P?