Overriding static member in child class with C#.NET,VB.NET

  • Home
  • Blog
  • Overriding static member in child class with C#.NET,VB.NET

Static member are accessible without creating the objects of the class so you don’t need to create a object for that class.

Micorosft CLR does not permit the static methods to be override in child class. But off course you can hide the static method of parent method with new keyword in child class. Here is the example of that.

public class A{ public static virtual void Test() { }}public class B : A{ public new override static void Test() { }

}