Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Java (http://www.programmingforums.org/forum17.html)
-   -   Using Association in Java (http://www.programmingforums.org/showthread.php?t=15078)

namsu Jan 29th, 2008 3:54 AM

Using Association in Java
 
I have only really used inheritance and composition in Java. Can someone provide me with an example on association. I want to try and make the program function the same way except by association. For inheritance I am obviously using the keyword extends and using the super keyword to call to the parent class. Thanks.

armandino Jan 30th, 2008 12:10 AM

Re: Using Association in Java
 
Quote:

Originally Posted by namsu (Post 140468)
I have only really used inheritance and composition in Java. Can someone provide me with an example on association. I want to try and make the program function the same way except by association. For inheritance I am obviously using the keyword extends and using the super keyword to call to the parent class. Thanks.

You have actually used associations more often than inheritance or compostion. An association is usually described as a "uses" relationship, that is when one object uses (invokes a method on) another object.


All times are GMT -5. The time now is 6:01 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC