Say you do this:
------------
DerivedType derivedInstance = new DerivedType();
BaseType baseVar = derivedInstance;
baseVar.CallMethod();
-------------
If the DerivedType.CallMethod() is defined as "new", the above code will
code the BaseType version. If it is defined as "override", it wil call the
DerivedType version.
If you are using inheritance to get polymorphism, you probably want
override.
Hope this helps,
Rachel
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
We can use new or override to rewrite a method in an child class.
But what is the difference between new and override?