.NET Fiddle

CSharp · Console

/Program.cs

using System;
				using System.Linq;
public class Program
{
    public static void Main()
    {
        Foo.Bar();
    }

}

class Foo 
{

	static Foo() { Console.WriteLine("Static constructor is called."); }

	public Foo() { Console.WriteLine("The constructor is called."); }
	
	public static void Bar() { Console.WriteLine("The static Bar method is called."); }
}
;