Object Oriented Programming MCQs with Answers
Practice important Object Oriented Programming MCQs with answers and explanations.
Chapter: 4
Q61:
The principle of abstraction focuses on capturing only those details about an object that are _______ to the current perspective.
A. relevant
B. irrelevant
C. complex
D. detailed
Correct Answer:
A
Chapter: 4
Q62:
The concept of generalization in object-oriented models reduces _______ and increases _______.
A. complexity; reusability
B. redundancy; maintainability
C. abstraction; inheritance
D. behavior; flexibility
Correct Answer:
B
Chapter: 4
Q63:
A class that extends the behavior of another class by adding new attributes is an example of _______.
A. specialization
B. extension
C. sub-typing
D. restriction
Correct Answer:
B
Chapter: 4
Q64:
In OO models, "Person" is an example of a(n) _______ class, while "Student" and "Teacher" are examples of _______ classes.
A. abstract; concrete
B. concrete; abstract
C. abstract; derived
D. derived; concrete
Correct Answer:
A
Chapter: 4
Q65:
Sub-typing allows a derived class to _______ the base class but also include additional characteristics.
A. override
B. ignore
C. replace
D. extend
Correct Answer:
D
Chapter: 4
Q66:
Which of the following statements about concrete classes is true?
A. They implement a concept and provide specific details for objects
B. They are used to generalize behavior and cannot be instantiated
C. They exist only at the top of the class hierarchy
D. They are often used to represent abstract concepts
Correct Answer:
A
Chapter: 4
Q67:
Specialization is used to _______ the general behavior of a class to fit specific needs.
A. extend
B. restrict
C. ignore
D. add
Correct Answer:
D
Chapter: 4
Q68:
Which of the following is NOT a benefit of inheritance?
A. Reuse
B. Redundancy
C. Reduced code complexity
D. Improved maintainability
Correct Answer:
B
Chapter: 4
Q69:
Abstract classes are typically placed _______ in a class hierarchy.
A. at the top
B. below concrete classes
C. intermediate
D. level-specific
Correct Answer:
A
Chapter: 4
Q70:
In the example of shapes, the Circle, Line, and Triangle are all _______ classes derived from the _______ class.
A. concrete; Shape
B. abstract; Shape
C. concrete; Geometric
D. abstract; Geometric
Correct Answer:
A
Chapter: 4
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
Correct Answer:
A
Chapter: 4
Q72:
The behavior of a derived class in inheritance can _______ the behavior of its base class.
A. extend
B. restrict
C. ignore
D. replace
Correct Answer:
A
Chapter: 5
Q73:
What is an advantage of multiple inheritance?
A. Decreases redundant code
B. Simplifies code
C. Reduces complexity
D. Increases code size
Correct Answer:
A
Chapter: 5
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
Correct Answer:
B
Chapter: 5
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
Correct Answer:
B
Chapter: 5
Q76:
In the AmphibiousVehicle example, which class method is inherited by AmphibiousVehicle?
A. Float()
B. Move()
C. changeGear()
D. swim()
Correct Answer:
C
Chapter: 5
Q77:
What type of association involves objects interacting without intrinsic relationships?
A. Aggregation
B. Simple Association
C. Composition
D. Inheritance
Correct Answer:
B
Chapter: 5
Q78:
Fill in the blank: In a two-way association, navigation is possible in ______ directions.
A. one
B. two
C. three
D. four
Correct Answer:
B
Chapter: 5
Q79:
In the Mermaid class, which method is overridden to resolve ambiguity?
A. swim()
B. eat()
C. walk()
D. Float()
Correct Answer:
B
Chapter: 5
Q80:
What type of association is represented by a line with a filled-diamond head?
A. Aggregation
B. Composition
C. Simple Association
D. Inheritance
Correct Answer:
B