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 Static methods can be overridden by static methods only? 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 "Static methods can be overridden by static methods only?" Watch "Static methods can be overridden by static methods only?" New topic
Author

Static methods can be overridden by static methods only?

Fox Hu
Ranch Hand

Joined: Jan 23, 2003
Posts: 49
Static methods can be overridden by static methods only ?
Shiva Mantri
Greenhorn

Joined: Dec 30, 2002
Posts: 19
Neal,
Please check http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#228745
A compile-time error occurs if an instance method overrides a static method.
. So you have to override with static method only. But in this case, it is called Hiding (continue reading section JLS8.4.6.2).
Hope this helps
-Shiva
Karin Paola Illuminate
Ranch Hand

Joined: Oct 18, 2002
Posts: 109
Any final, static and private methods in a class cannot be overridden.
My Study Notes


I not only use all the brains that I have, but all that I can borrow. [Laurence J. Peter]
Fox Hu
Ranch Hand

Joined: Jan 23, 2003
Posts: 49
Thank you
 
Don't get me started about those stupid light bulbs.
 
subject: Static methods can be overridden by static methods only?
 
Similar Threads
fun with main() and abstract
static methods
Static methods are inherited but not overriden
method overriding
Is inheritance is necessary to override?