aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Definition HAS-A Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Definition HAS-A" Watch "Definition HAS-A" New topic
Author

Definition HAS-A

Juan Manuel Alberto de los Santos
Ranch Hand

Joined: Jun 26, 2008
Posts: 48
Could you explain me this definition in simple code ?

Has-a relationships can be represented by using
reference variables as instance variables.
Bob Ruth
Ranch Hand

Joined: Jun 04, 2007
Posts: 320
Kinda simple example but it expresses the point:



The Bird "has" one beak and two wings. the reference variables myBeak and myWings are instance variables that are also references to other objects. In that case we say that Object A "has" the other objects.


------------------------
Bob
SCJP - 86% - June 11, 2009
Raphael Rabadan
Ranch Hand

Joined: Jul 05, 2008
Posts: 141
Well, just see the code, i think u'll understand :-)



EDIT: Sorry, posted at same time.
[ July 29, 2008: Message edited by: Raphael Rabadan ]

SCJP Java 6 (98%) - Story, SCJA (88%) - Story
Juan Manuel Alberto de los Santos
Ranch Hand

Joined: Jun 26, 2008
Posts: 48
understood

thanks !
[ July 29, 2008: Message edited by: Juan Manuel Alberto de los Santos ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Definition HAS-A