static void Main() { StaticClass.DoWork(); StaticClass.NestedClass nested = new StaticClass.NestedClass(); Console.WriteLine("CallCount = {0}", StaticClass.CallCount); }
static void Main() { StaticClass.DoWork(); // OOPS! Cannot do this! // StaticClass obj = new StaticClass(); StaticClass.NestedClass nested = new StaticClass.NestedClass(); Console.WriteLine("CallCount = {0}", StaticClass.CallCount); }