Answers for "constructor in static class c#"

C#
1

c# public static string

public static string saytest = "test";

private static void Main()
{
  Console.WriteLine(saytest);
}
Posted by: Guest on March-02-2020
2

static class constructor c#

class SimpleClass
{
    // Static variable that must be initialized at run time.
    static readonly long baseline;

    // Static constructor is called at most one time, before any
    // instance constructor is invoked or member is accessed.
    static SimpleClass()
    {
        baseline = DateTime.Now.Ticks;
    }
}
Posted by: Guest on August-21-2020

C# Answers by Framework

Browse Popular Code Answers by Language