• Post Reply Bookmark Topic Watch Topic
  • New Topic

ClassA has classB  RSS feed

 
Kok Lum Chan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

What does it mean when you see a statement stated "ClassA has ClassB"

Is it referring to inner class or inheretence or something else ?

Thanks.



 
Ralph Cook
Ranch Hand
Posts: 479
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would expect it to mean that ClassA has a reference to ClassB. But many people do not use the term precisely, and without some context or something else to go on, I would not trust my expectation too far.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally it's referring to composition. A car HAS-A engine. A house HAS-A plumbing system.

In OO design, it usually means something like



You can say that A HAS-A B, an int, and a String.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!