This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes What are the rules for using 'super' keyword ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What are the rules for using Watch "What are the rules for using New topic
Author

What are the rules for using 'super' keyword ?

ashwin bhawsar
Ranch Hand

Joined: Mar 16, 2011
Posts: 62

What are the rules/restructions/scenarios for how & where we can and cannot use the 'super' keyword.
shaileshkumar mistry
Greenhorn

Joined: Dec 19, 2011
Posts: 19

can
super.<method_Name>() is used to call a method of super class.
super keyword can be use to call the constructor of the superclass in the base class.


can't
super keyword can not be used inside static methods.


Thanks and Regards

OCPJP 100%
 
Don't get me started about those stupid light bulbs.
 
subject: What are the rules for using 'super' keyword ?