LearnFrenzy
Sign in Take a free test

Inheritance · Inheritance MCQ · Question 1

Which relationship does public inheritance express? Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 1 Back to Exercise

Which relationship should class Car : public Vehicle express?

  • A Car HAS-A Vehicle
  • B Car IS-A Vehicle Correct
  • C Vehicle IS-A Car
  • D Car USES-A Vehicle
Correct Answer: Option B

Public inheritance means a Car can be used wherever a Vehicle is expected. HAS-A relationships use composition.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links