• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Composition vs Inheritance...

 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is the difference between Composition vs Inheritance....thanks
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ritesh raushan wrote:what is the difference between Composition vs Inheritance....thanks


I suspect that this is the 1,000,001st time this question has been asked. I suggest you search for other threads or paste your subject title into Google and find an explanation that you understand.

Winston
 
Ranch Hand
Posts: 300
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ritesh,

Inheritance is "IS-A" relationship like truck is a vehicle , while composition is "has-a" relationship like truck has a wheels. Inheritance means using the existing functionality while composition means you need to compose the functionality.

This article will give you the better understanding.

http://www.javaworld.com/jw-11-1998/jw-11-techniques.html
 
Ritesh raushan
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Winston Gutkowski wrote:

Ritesh raushan wrote:what is the difference between Composition vs Inheritance....thanks


I suspect that this is the 1,000,001st time this question has been asked. I suggest you search for other threads or paste your subject title into Google and find an explanation that you understand.

Winston





ok..thank you sir
 
Ritesh raushan
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jatan bhavsar wrote:Hi Ritesh,

Inheritance is "IS-A" relationship like truck is a vehicle , while composition is "has-a" relationship like truck has a wheels. Inheritance means using the existing functionality while composition means you need to compose the functionality.

This article will give you the better understanding.

http://www.javaworld.com/jw-11-1998/jw-11-techniques.html




Thank you very much...i am going to read on javaworld
 
If you try to please everybody, your progress is limited by the noisiest fool. And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic