Asked by Shazzad Hossain on Sep 27, 2024

verifed

Verified

Inheritance indicates a/an ____________ relationship.

A) Is-a
B) Has-a
C) both A & B
D) none of the above

Inheritance

A principle in object-oriented programming that allows a class to inherit properties and methods from another class, promoting reusability.

Is-a

A relationship in object-oriented programming indicating that one class is a subtype of another, inheriting its properties.

  • Differentiate between the concepts of composition and inheritance and understand their unique roles within the framework of object-oriented programming.
verifed

Verified Answer

NK
Neetal Kaliaabout 2 hours ago
Final Answer :
A
Explanation :
Inheritance indicates an "is-a" relationship between classes, meaning that the subclass is a type of the superclass. For example, a Dog class would be a subclass of the Animal class, indicating that a dog is a type of animal. "Has-a" relationship refers to composition which is different from inheritance.