File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Static methods can be overridden by static methods only?

 
Fox Hu
Ranch Hand
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Static methods can be overridden by static methods only ?
 
Shiva Mantri
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 109
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any final, static and private methods in a class cannot be overridden.
My Study Notes
 
Fox Hu
Ranch Hand
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic