1

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

avakar
  • 32,009
  • 9
  • 68
  • 103
odiseh
  • 25,407
  • 33
  • 108
  • 151

3 Answers3

2

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

Pete Kirkham
  • 48,893
  • 5
  • 92
  • 171
1

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
  • 64,141
  • 14
  • 108
  • 120
1

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
  • 80,725
  • 18
  • 167
  • 237