• Post Reply Bookmark Topic Watch Topic
  • New Topic

question from Master Exam 3  RSS feed

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 3185
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Water! People swim in water! Even tiny ads swim in water:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!