This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes super keyword Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "super keyword " Watch "super keyword " New topic
Author

super keyword

Satyajeet Kadam
Ranch Hand

Joined: Oct 19, 2006
Posts: 215
If your method overrides one of its superclass's methods, you can invoke the overridden method through the use of the keyword super.

Q1) In below example why we are able use super keyword to invoke super class version of overloaded method ?






Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3011
    
  34

amolpalekar kadolkar wrote:If your method overrides one of its superclass's methods, you can invoke the overridden method through the use of the keyword super.

Yes, but you can use that keyword to call any accessible method in the super class, despite it was overridden or not.

Founder of ExamLab and Systemup
See how I can help you to become an awesome programmer
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: super keyword
 
Similar Threads
Strange "this" behavior
Overloading & Overriding!
merge() operation in hibernate
deciding method from which class to call depending upon parameter passed in
Regarding Method Shadowing