An object reference is required for the non-static field, method Error in console application
I have created a console application and declared a string a and assigning in code I am getting error.
namespace ConsoleApplication1
{
class Program
{
string a;
static void Main(string[] args)
{
Console.WriteLine("Hello!");
}
}
}