What is the difference between new and override keywords in C#
override is for polymorphic behavior of the member function/method. new is for member hiding / member shadowing.
new keyword - New Definition for a method.
overide keyword - Override existing definition for a method.
using
class
{
Console.WriteLine("Base::Message");
}
~Base()
Console.WriteLine("Base::Destructor");
sealed
Console.WriteLine("Derived::Message");
~Derived()
Console.WriteLine("Derived::Destructor");
Base obj =
obj.Message();