views:

128

answers:

3

Hi... What's the Practical usage of new (modifier) functions?

+1  A: 

The new modifier in C# allows you to redefine a method in a subclass hiding the base class method.

I would mainly use it for modifying a non-virtual method in a subclass.

Patrick McDonald
+2  A: 

It's an attempt to work around an aspect of the fragile base class problem.

Pete Kirkham
+1  A: 

The use of new is when you want a function of the same name, but you don't want to override. It is identical to the reintroduce keyword in Delphi.

James