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

Why can't a statice method can be overriden to a non-static method?

 
Narasimha Rao B.
Ranch Hand
Posts: 205
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why can't a statice method can be overriden to a non-static method? and vice vera.
 
Arun Boraiah
Ranch Hand
Posts: 233
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
static method can be called even if the instance of class is not created. Since they are loaded at the time of class creation. So if you override static method by non static method , which can be called by creating instance of object.
does it make since to override it?
As a good programming practice. We should not use static method until it is required. Might be this one of the reason they are imposing such rule.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Static methods can't be overridden anyway - they aren't polymorphic.
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ilja Preuss:
Static methods can't be overridden anyway - they aren't polymorphic.

You have done well, grasshopper.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic