Hi there, I'm studying for the
SCJP 5 which I'm going to take tomorrow (so nervous!)
I have a question about the "has-a" relationship. According to K&B Chapter 2, page 164, the Self-Test answers for question 1 says that "Has-a relationships always rely on instance variables". This is option B, and is marked as being the correct answer.
I distinctly remember a very similar question on one of the Master Exams that came with the book, and it said that the above was not true because Has-a relationships can also apply to static variables, which are CLASS variables, not instance variables.
I skimmed through the K&B errata but didn't find anything on it.
I realize this may be a bit trivial but since I did see a question on the practice directly asking this, I was wondering if anyone had any insight.
Do static variables count as Has-A?
EDIT: I'm working with K&B for 1.5, just to be clear
[ August 31, 2006: Message edited by: Sara Haider ]