how to access static variable in c#

Gow.Net
Posted by Gow.Net under C# category on | Points: 40 | Views : 2277
 class Program
{
static int y = 20;
public static void Main()
{
int y = 200;
Console.WriteLine(y);//local y int y=200;
Console.WriteLine(Program.y);//static y
}
}

Comments or Responses

Login to post response