See Also: Unit 3: Relationships - Inheritance
See Also: 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
3. Which of the following is an example of an "is-a" relationship?
A) A car has an engine
B) A dog is a mammal
C) A library is composed of books
D) A person owns a house
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
Unit 5:
1. Which of the following best describes a String in C++?
A) A primitive data-type
B) An array of characters
C) An object that represents a sequence of characters
D) A class that cannot be instantiated
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
6. What is an ATM (Automated Teller Machine) an example of in terms of Object-Oriented
Programming?
A) A data collection
B) A multi-threaded application
C) A case study
D) An exceptional handling scenario
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