Hi,
First of all any type of relation is called an Association.
Now there are various types of association between classes/objects.
Among them are two types of association:
1. i*s-a (Inheritance)*
Example : *red apple* is-a *apple *is-a *fruit *is-a *food*
*
*2. *has-a(aggregation)*
*car *has-a *head-light* has-a *bulb*
Hope that gives you some idea.
Thanks,
Nirmal
\\\///
/ \
| \\ // |
( | (.) (.) |)
----------o00o--(_)--o00o-------------------
Stand up,be bold,be strong.
Take the whole responsibility on
ur own shoulders and know that
U are the creator of ur own destiny.
------ooo0-------------------------------------
( ) 0ooo
\ ( ( )
\_) ) /
(_/
On Mon, Aug 31, 2009 at 4:13 PM, Shubha Roy <[email protected]>wrote:
> I am a bit confused about has-a and is-a relationship in inheritance can
> anyone clarrify
> cheers
> shubha
>
> Shubha Roy
>
>
> <http://sigads.rediff.com/RealMedia/ads/click_nx.ads/www.rediffmail.com/signatureline....@middle?>
> >
>
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---