• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

confused by the MindQ' question

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
22. If you want subclasses to access, but not to override a superclass member method, what keyword should precede the name of the superclass method? (Fill in blank).
I wrote: super but the MindQ says it's wrong.
Was I wrong?
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think it should be "final" -- can somebody confirm?

Originally posted by yanish:
22. If you want subclasses to access, but not to override a superclass member method, what keyword should precede the name of the superclass method? (Fill in blank).
I wrote: [b]super
but the MindQ says it's wrong.
Was I wrong?[/B]


 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your are right. This is actually the purpose of final keyword when applied to methods. This means that the behaviour of the method is final and cannot be changed by overriding it in the subclass.
Who can access this method depends on the accessiblity control keyword ie. public , protected etc.
http://pages.about.com/jqplus

------------------
Get Certified, Guaranteed!
 
Ruth Stout was famous for gardening naked. Just like this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic