Difference between Method Overriding and Method Hiding in C#
when I started learning C# I didn't actually get what's with this new keyword which "hide" the method. method hiding name could be confusing for non-English speaker like me, I assumed that by "hiding" it actually deletes the old method and we can no longer access it, however that's not true. here is an example in which we are hiding a method and calling the parents method: namespace Test { public class T1 { public virtual void M() { System.Console.WriteLine("method from T1 class called"); } } public class T2 : T1 { public new void M() { System.Console.WriteLine("method from T2 class called"); } } public class Program { public static void Main(string[] args) { T1 obj2 = new T2(); obj2.M(); } } } The output of this C# program will be: method from T1 class called which makes sense b...