Win a copy of Spark in Action this week in the Open Source Projects 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Sybex Flash Card Set#2 #48 Errata?

 
Ranch Hand
Posts: 312
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the definition of Hidden from Sybex Flash Card Set#2 #48 correct?


Definition
Overloaded methods share the same name but different signatures and have no polymorphic relationship. Overridden methods share the same signature and are replaced at runtime in all places it is defined. Hidden methods are share the same signature but are only replaced in the subclasses for which they are defined.




From page 263
... hidden methods only replace parent methods in the calls defined in the child class.
...
Alternatively, at runtime the parent version of a hidden method is always executed if the call to the method is defined in the parent class.

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think, which method will be called depends on the reference type. The following snippet will always invoke the (hidden) parent method, and the place where it is called is insignificant.

I don't understand the context to the place where a hidden method is called. Can someone give an example?
 
Here. Have a potato. I grew it in my armpit. And from my other armpit, this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic