Answers for "static variable in non 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
1

static class can have non static member in c#

Static class can't contain non-static members because by definition it can't be instantiated so there's no possibility to use these members. However, static members in non-static class can be used without having class instance - a bit different scenario,
Posted by: Guest on October-02-2020

Code answers related to "static variable in non static class c#"

C# Answers by Framework

Browse Popular Code Answers by Language