aspose file tools*
The moose likes Beginning Java and the fly likes Composition vs Inheritance... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Composition vs Inheritance..." Watch "Composition vs Inheritance..." New topic
Author

Composition vs Inheritance...

Ritesh raushan
Ranch Hand

Joined: Aug 29, 2012
Posts: 100
what is the difference between Composition vs Inheritance....thanks
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7081
    
  16

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


Isn't it funny how there's always time and money enough to do it WRONG?
Artlicles by Winston can be found here
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

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

Joined: Aug 29, 2012
Posts: 100
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

Joined: Aug 29, 2012
Posts: 100
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Composition vs Inheritance...
 
Similar Threads
Composition Vs Inheritance
Extending vs Reference
1.3Associations vs Compositions
Class form Adapter VS Object form Adapter
Inheritance vs Aggregation