| Author |
a true or false statement
|
adam Lui
Ranch Hand
Joined: Sep 03, 2007
Posts: 186
|
|
A has-a relationship can be established by using ojbect reference variables a as local variables. true or false. Why? [ October 19, 2007: Message edited by: adam lui ]
|
boolean b = true;<br />System.out.println ("I believe in Java.<br />Java will make my dream come " + b);
|
 |
palla sridhar
Ranch Hand
Joined: Oct 15, 2007
Posts: 111
|
|
Hi Adam! It was a nice question to ask. As far as i know, if a class contains object reference variable as instance variable, then that's a HAS-A relatinship. For example: means Animal HAS-A Dog. If you also check K&B, there is also an example like this:. The book says that
Users of a Horse should not even need to know that there is such a thing as a Halter class.
So if you go by this explantion, users of a class dont even need to know that there is a local object reference variable, which implies that local object reference variables also follow HAS-A relationship. So my answer is TRUE and for why? above is the explanation.. This is what i think, anybody please correct me if i'm wrong!!
|
Thanks and Regards,
[url]www.techlikes.com[/url]
*Nothing is CONSTANT in life, except CHANGE*
|
 |
Rahul Shilpakar
Ranch Hand
Joined: Aug 29, 2006
Posts: 132
|
|
|
yes its true
|
Perform for today. Adapt for tomorrow.
|
 |
 |
|
|
subject: a true or false statement
|
|
|