• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

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
 
Surfs up space ponies, I'm making gravy without this lumpy, tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic