• 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
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!