Which relationship is represented by inheritance in object-oriented programming?

Options

  • A. Has-a relationship
  • B. Is-a relationship
  • C. Uses-a relationship
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

B. Is-a relationship

Detailed Explanation

Explanation: Inheritance represents an IS-A relationship. For example, a Dog IS-A Animal. Composition generally represents a HAS-A relationship.