Originally posted by ansuman mohapatra:
hey thanks 4 writin in...
but the doubt I have is in static methods overriding is not allowed, rather they allow method redifinition !!...That I didnt understand.
If method redefining refers to overloading or overriding then whats the difference of "Static Methods can't be overriden but can be redefined".
Its very basic to say "Static Methods can't be overriden but can be redefined". I would say that "Static method can be overidden !!,but they cant be overriden to be non-static" ie Static methods doesn't adhere to Dynamic Polymorphism or Dispatch.
Take this example :
If a.meth1() calls Super class method then i dont think static method respond to dynamic dispatch calls, unlike a.meth2() which does.
Apart form saying redifining static method i would consider saying it as Hidding Static methods, because static methods are hidden not overriden.
In this case Hidding/Redifining differs a lot with Overriding.