How to Initialize the Static Variables via Static Constructors in C# ?

Do you want to initialize the static variables in static constructors in C# ? Below is a sample code snippet that demonstrates how to do it .

How to Initialize the Static Variables via Static Constructors in C# ?

public class StaticData
{
  private static int AbundantCode;
  static StaticData()
  {
    AbundantCode = 0;
  }
}