Hi Prasad,
Prasad says:
But i want to know what is the difference between overriden and re-define
In one line,
Overriding means
polymorphism can be availed.
Redefining means no polymorphism.
Polymorphism means, being able to bind subclass methog at run time
using the base class reference variable.
Animal ani = new Dog();
ani.eat(); //at run time Dog's eat will be selected. (if dog overrides it) This is called polymorphism.
Redefining, you can understand in case of static method. methods will be selected on behalf of what is the type of reference type instead of what object it is referring to.
Regards,
cmbhatt