Here is a quick way to test. Copy the following code and paste it to your IDE (Visual Studio). Then uncomment each of the two commented lines, one at a time.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StaticTest
{
static class Program
{
/**
* Uncomment one line at a time and compile program.
**/
//public int NonStaticVariable = 0;
//public static int StaticVariable = 0;
static void Main(string[] args)
{
}
}
}
You will notice that for the non-static variable, the complain:
'StaticTest.Program.NonStaticVariable': cannot declare instance members in a static class
This is because, in .NET, a static class can contain only static members. If you are looking to read further into this, follow this link: http://msdn.microsoft.com/en-us/library/79b3xss3.aspx