Confusion of access level of variables in static method.
using System;
namespace ConsoleApplication19
{
class Program
{
int a = 10;
static int b = 10;
static void myfun()
{
int j = 10;
Console.WriteLine("Hello {0}",j); // valid
Console.WriteLine("Hello {0}", a); //invalid
Console.WriteLine("Hello {0}", b); //valid
}
static void Main(string[] args)
{
myfun();
Console.ReadKey();
}
}
}