RELATIONSHIPS
IS-A : Is-A relation is that relation in which the child class inherits all the properties of super class. The best e.g of explaining this relationship is as follow, Rose IS-A flower.In this example flower is the super class and Rose is the child class .Rose inherits all those properties which a flower have.
HAS-A : Has -A relation is that relation in which the child class do not have all properties of super class.In this type of relation the child class inherits only some properties of super class .
IS-A : Is-A relation is that relation in which the child class inherits all the properties of super class. The best e.g of explaining this relationship is as follow, Rose IS-A flower.In this example flower is the super class and Rose is the child class .Rose inherits all those properties which a flower have.
HAS-A : Has -A relation is that relation in which the child class do not have all properties of super class.In this type of relation the child class inherits only some properties of super class .
0 comments:
Post a Comment