• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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!
 
Won't you be my neighbor? - Fred Rogers. tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic