Inheritance (IS-A) vs. Composition (HAS-A) Relationship
please someone explaine what is Inheritance (IS-A & HAS)relationship in java
please someone explaine what is Inheritance (IS-A & HAS)relationship in java
Inheritance: Dog
'is an' Animal
. In Java this is done by the extends
keyword.
Composition: Dog
'has' Eyes
. In Java this is done by having Dog an instance object of Eye.