Multiple choice technology programming languages

Public inheritance signifies__________ relation ship

  1. for a

  2. is a

  3. with a

  4. has a

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Public inheritance in object-oriented programming represents an 'is-a' relationship. A derived class publicly inheriting from a base class should be able to substitute for the base class (Liskov Substitution Principle). For example, if 'Car' inherits publicly from 'Vehicle', a Car IS-A Vehicle. This is in contrast to composition, which represents a 'has-a' relationship.