+ 2

Association And Inheritance one basic different today i learn

Association has a relationship. Inheritance is a relationship . for eq--> class Vechile { } class Car extends Vechile { } →→→car is a vechile or vechile is car.. car has a music system is a Association.. If i'm wrong somewhere pls correct me???

3rd Apr 2018, 8:37 AM
Arun Tomar
Arun Tomar - avatar
3 Respuestas
+ 9
Car is-a vehicle. Good example, I think you got it ;)
3rd Apr 2018, 8:57 AM
Tashi N
Tashi N - avatar
+ 2
thanks and.. i really appreciate. you for your patience while try to explain me..
3rd Apr 2018, 10:28 AM
Arun Tomar
Arun Tomar - avatar
+ 2
Inheritence is "is-a" relationship. e.g Car is a vehicle. Association is "has-a" relationship. e.g Car has a music system.
3rd Apr 2018, 12:20 PM
Mitali
Mitali - avatar