This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes static methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "static methods" Watch "static methods" New topic
Author

static methods

sonali rao
Ranch Hand

Joined: Nov 03, 2003
Posts: 64
Can static methods be orver ridden?
Sindhur Sat
Greenhorn

Joined: Feb 23, 2004
Posts: 23
NO
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Nope, but they can be hidden. Static methods are not polymorphic. Consider the following:

In this scenario, instances of C can accesses any of the static methods by qualifying the call with the class:

But now C can no longer access the instance methods of A since a super call only applies to B. In the above example, if the class qualifier is removed, then the hidden static method defined in the subclass will be called or the most immediate super class that hides the static method.


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: static methods
 
Similar Threads
Static methods can be overridden by static methods only?
static and non-static synchronized methods
method overriding
Inheritance of all members
What is the logic behind calls like JOptionPane.method()