File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Super Keyword use Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Super Keyword use" Watch "Super Keyword use" New topic
Author

Super Keyword use

Yatin Bhor
Greenhorn

Joined: Jan 09, 2013
Posts: 1

Hi,
Can i use Super keyword in static method or static block???
rushikesh kalikar
Greenhorn

Joined: Jul 13, 2011
Posts: 7
Hi,

super keyword cant call any method.It will call only Superclass constructor.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Welcome to CodeRanch

Yatin Bhor wrote: Can i use Super keyword in static method or static block???

I do suggest you to experiment it yourself. in that way you may learn some other things also .
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

rushikesh kalikar wrote:
super keyword cant call any method.

using super you can also call super class's instance methods.
this is useful when you have to call super class method in overridden method of subclass.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Super Keyword use