This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes HAS-A-Relationship (K&B) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "HAS-A-Relationship (K&B)" Watch "HAS-A-Relationship (K&B)" New topic
Author

HAS-A-Relationship (K&B)

Sasha Ruehmkorf
Ranch Hand

Joined: Mar 29, 2007
Posts: 115
From K&B selftest of chapter 2:
Has-a relationships always rely on instance variables.
is the correct answer

From K&B BonusExam, question 52:
Has-a relationships are always defined with instance variables
is false, as
class variables can also be used to define has-a relationships


Could someone plaese clarify?
(Searching the web just confused me more... :-( )
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Discussed here


Thanks,


cmbhatt
Sasha Ruehmkorf
Ranch Hand

Joined: Mar 29, 2007
Posts: 115
Thanks, but that topic is about is-a relationships. I don't see the connection.
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Hi Sasha,

You are right, Has-A Relationship can also be acquired using class variables.


Thanks,
 
 
subject: HAS-A-Relationship (K&B)