MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SOFTWARE ENGINEERING

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Inheritance models the ____ relationship
A
has-a
B
is-a
C
uses-a
D
None of the above
Explanation: 

Detailed explanation-1: -Inheritance is used to model is-a relationships between classes; such relationships could include either behavior and state or just behavior alone. Use this course to appreciate how classes can be used to model an entity’s state and behavior and inheritance to model is-a relationships between two classes.

Detailed explanation-2: -An inheritance relationship is an essential feature that distinguishes object-oriented languages from conventional ones. From the domain view, an inheritance relationship organizes classes in hierarchical structures. This allows us to model a hierarchy of terms using generalizations and specializations.

Detailed explanation-3: -3. Which type of relationship is modelled by Inheritance? Explanation: Inheritance models Is-A type of relationship between classes. This is because in this case derived class inherits all property of the base class and Is-A type of B class.

There is 1 question to complete.