Unit 3: Relationships - Inheritance
Unit 3: Relationships - Inheritance
Unit 3: Relationships - Inheritance
9. What is the term for the process of destroying objects in Object-Oriented Programming?
A) Construction
B) Destructive method
C) Destructor
D) Garbage collection
10. When identifying classes in Object-Oriented Programming, what are candidates for classes?
A) Methods
B) Attributes
C) Shared behavior and state
D) Message passing strategies
2. What term best describes the relationship between a subclass and its superclass in inheritance?
A) Has-a
B) Is-a
C) Association
D) Aggregation
5. What term is used to describe a stronger form of association where one class "owns" objects of
another class?
A) Inheritance
B) Aggregation
C) Composition
D) Encapsulation
10. Which relationship in Object-Oriented Programming allows for the reusability of code by enabling
a subclass to inherit features from a superclass?
A) Aggregation
B) Association
C) Inheritance
D) Composition
Unit 4: Polymorphism
1. What is polymorphism in Object-Oriented Programming?
A) The process of hiding the implementation details of an object's state
B) The process of creating duplicate objects
C) The ability of a method to do different things based on the object it is acting upon
D) The process of defining multiple constructors for a class
9. In C++, can a subclass method override a superclass method with a broader access modifier?
A) Yes
B) No
5. In a Library Management System, what data collection might be used to store information about
books and their availability?
A) ArrayList
B) HashSet
C) TreeMap
D) LinkedList
10. In a Library Management System, what data collection might be used to store information about
library members and their borrowed books?
A) HashSet
B) LinkedList
C) TreeMap
D) HashMap