RSS Forums RSS
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 1930 | Replies: 5 | Thread Tools  Display Modes
Reply
Join Date: Aug 2005
Posts: 13
Reputation: Manojsah is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 2
Manojsah Manojsah is offline Offline
Newbie Poster

Composition

  #1  
Sep 7th, 2005
Hi
I am having problems in getting Composition ?
pls tell about it.

thanks
Manoj
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Location: Socialist Republic of Boulder
Posts: 216
Reputation: hooknc is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 6
hooknc hooknc is offline Offline
Posting Whiz in Training

Re: Composition

  #2  
Sep 7th, 2005
Composition is the act of taking two smaller items and putting them together to make a larger item.

Like a door handle being added to a door frame makes a door.

Regards,

Nate
Reply With Quote  
Join Date: Aug 2005
Posts: 4
Reputation: kingmahesh is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
kingmahesh kingmahesh is offline Offline
Newbie Poster

Re: Composition

  #3  
Sep 8th, 2005
Composition (called “has-a�) is a relationship between classes where one class has a data member that is an instance of the other class, such as “a car has a tire�. When creating a program, you need to choose whether to relate classes through inheritance or composition.


king
Reply With Quote  
Join Date: Sep 2005
Posts: 51
Reputation: tristan17 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
tristan17 tristan17 is offline Offline
Junior Poster in Training

Re: Composition

  #4  
Sep 9th, 2005
Originally Posted by kingmahesh
Composition (called “has-a�) is a relationship between classes where one class has a data member that is an instance of the other class, such as “a car has a tire�. When creating a program, you need to choose whether to relate classes through inheritance or composition.


king

hi all,

with regard to composition and inheritance, there is a term named as polymorphism...is it related to the above? so infact, composition is inheritance, but in my class, we usually called the method as inheritance and the sub-classes have the attributes and properties of the main class. i mean from the main-class, u will have the sub-classes and the relationship is called inheritance. hope that what i understand can be of use to you. cheers!
Reply With Quote  
Join Date: Aug 2005
Location: Socialist Republic of Boulder
Posts: 216
Reputation: hooknc is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 6
hooknc hooknc is offline Offline
Posting Whiz in Training

Re: Composition

  #5  
Sep 9th, 2005
Originally Posted by tristan17
hi all,

with regard to composition and inheritance, there is a term named as polymorphism...is it related to the above? so infact, composition is inheritance, but in my class, we usually called the method as inheritance and the sub-classes have the attributes and properties of the main class. i mean from the main-class, u will have the sub-classes and the relationship is called inheritance. hope that what i understand can be of use to you. cheers!

Polymorphic behavior is more of a "is-a" relationship then a "has-a" relationship. A Circle is a type of Shape and should be able to be viewed as a Shape and have all the same behavior (methods) as Shape. Polymorphism is accomplished by both inheritance and interfaces in java.

Regards,

Nate
Reply With Quote  
Join Date: Aug 2005
Posts: 13
Reputation: Manojsah is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 2
Manojsah Manojsah is offline Offline
Newbie Poster

Re: Composition

  #6  
Sep 9th, 2005
Hello To all who had make me to understand the basic Funda of Composition.

Can any of u please tell me where to use RECURSSION IN PROGRAM.
or WHEN THE PROGRAM DEMANDS IT.


regards

Manojsah
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the Java Forum
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 7:27 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC