Which object-oriented concept allows a class to acquire properties and methods of another class?

15 views
  • Association
  • Composition
  • Inheritance (Correct Answer)
  • Aggregation

Explanation

Inheritance allows a class (subclass) to inherit attributes and methods from another class (superclass), enabling reusability and hierarchical relationships. Composition/aggregation define part-whole relationships, and association represents relationships between objects.

Comments (0)

No comments yet. Be the first to comment!

Want to practice more?

Explore thousands of MCQs across every exam category on Exams Nepal.

Find More MCQs