Huachaitou Peek wrote:This is true or false question from Master Exam 3, Has-a relationships always rely on instance variables. The answer is true.
I think I have read from somewhere and the answer is false because static variable can be counted. Does anybody knows what the correct answer is ? Thanks.
So you have something called- HAS-A and IS-A relationship. Let me explain HAS-A:
So in the above code sample- Person
HAS-A Address- This relationship is due to the fact that Person has an instance variable of type Address. So its true that HAS-A relies on Instance variables.
Note: This should have been asked on forum before as well.