This week's book giveaway is in the Python forum.
We're giving away four copies of Python Continuous Integration and Delivery and have Moritz Lenz on-line!
See this thread for details.
Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!