Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

instance variables and run time polymorphism  RSS feed

 
Renu Radhika
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if instance variable doesnt exhibit run time polymorphic behaviour like static variables even though they belong to an instance and not a class
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the question?
 
Renu Radhika
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no unlike overridden methods in inheritance,the redeclared variables wont be decided at runtime(for eg to a base class reference we assign a derived class instance the instance variable values will be that of base class),any specific advantage
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!