Object Oriented Programming MCQs with Answers
Practice important Object Oriented Programming MCQs with answers and explanations.
Multiple Choice Questions
Q71: A class that represents a general concept and cannot be instantiated is known as a(n) _______ class.
- A: abstract
- B: concrete
- C: derived
- D: partial
View Answer
A
Q72: The behavior of a derived class in inheritance can _______ the behavior of its base class.
- A: extend
- B: restrict
- C: ignore
- D: replace
View Answer
A
Q73: What is an advantage of multiple inheritance?
- A: Decreases redundant code
- B: Simplifies code
- C: Reduces complexity
- D: Increases code size
View Answer
A
Q74: In the Mermaid class example, what does the swim() method belong to?
- A: Woman class
- B: Fish class
- C: Mermaid class
- D: Amphibious Vehicle class
View Answer
B
Q75: Which of the following is a problem with multiple inheritance?
- A: Decreased code reuse
- B: Increased complexity
- C: Simplified object model
- D: Decreased memory usage
View Answer
B
Q76: In the AmphibiousVehicle example, which class method is inherited by AmphibiousVehicle?
- A: Float()
- B: Move()
- C: changeGear()
- D: swim()
View Answer
C
Q77: What type of association involves objects interacting without intrinsic relationships?
- A: Aggregation
- B: Simple Association
- C: Composition
- D: Inheritance
View Answer
B
Q78: Fill in the blank: In a two-way association, navigation is possible in ______ directions.
- A: one
- B: two
- C: three
- D: four
View Answer
B
Q79: In the Mermaid class, which method is overridden to resolve ambiguity?
- A: swim()
- B: eat()
- C: walk()
- D: Float()
View Answer
B
Q80: What type of association is represented by a line with a filled-diamond head?
- A: Aggregation
- B: Composition
- C: Simple Association
- D: Inheritance
View Answer
B