Pages

Tuesday, October 9, 2012

Difference between "override" and "new" keyword

"New" modifier is used to hide a member inherited from a parent class which is not virtual. This does not have the polymorphic behavior, so if someone calls the parent class method, the implementation in the method which "new" modifier has been used is not been called.

"Override" modifier can be used to override virtual or abstract members and it contains the polymorphic behavior.