Short description of Is-A and Has-A relationship in OOP

thip
thipwriteblog
Published in
1 min readMar 28, 2017

OOP (Object Oriented Programming) has two common relationship of objects. It’s call “Is-A” and “Has-A” relationship. To avoid long description that make you confused, I have a very short description that make you get concept in a minute. Please see below.

“Is-A” — A child is a part of parent

For example is :-

  • A rose is a flower
  • A dog is an animal

“Has-A” — An object has a subset of object

For example is :-

  • A rose has a leaf
  • A dog has a legs

That’s it!!

--

--