• Post Reply Bookmark Topic Watch Topic
  • New Topic

HAS-A relationships  RSS feed

 
leo donahue
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Does Animal have a Halter?
Since private members can only be accessed by code in the same class, is the Halter class in the same class as Horse?
I guess my question is when you are trying to identify objects in a process, how do you know that you have related the object to the right "other object"?
Am i making any sense?
 
leo donahue
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now this is getting bad, I'm answering my own questions....
No, Animal doesn't have a Halter, unless you wrote it with one and made subclasses provide an implementaion for it, which we didn't because not every abstract Animal HAS-A Halter.
After doing some more searching, private members are only accessible to code in the same class in which the private member was declared.

I had a bunch of other questions here, but I erased them as I talked myself through them. It started making sense.
See, chocolate chip cookies and Mt. Dew at 9 am isn't so bad for you...you start to understand stuff...
[ June 19, 2003: Message edited by: leo donahue ]
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad we could help you out leo. Now how 'bout passin' some o' them cookies this way.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!