Static variables are scoped to the type they are defined in for a given AppDomain. They are also shared across threads, unless you use the ThreadStaticAttribute, at which point they become per thread.
Class members are obviously scoped to an instance of the class, but are not "global" to derived classes. Depending on the access modifier the member may be visible to derived instances also.
Classes with generic arguments have a static variable per closed generic type:
class MyClass<T> { public static string Name; }
So MyClass<int> will have its own copy of Name and MyClass<string> will have a different copy.
Looking at your choice of answer, it seems like you want a static variable per derived class?
You can cheat and use the generics rule above:
class Program { static void Main(string[] args) { Derived1.WhatClassAmI = "Derived1"; Derived2.WhatClassAmI = "Derived2"; Console.WriteLine(Derived1.WhatClassAmI); // "Derived1" Console.WriteLine(Derived2.WhatClassAmI); // "Derived2" Console.WriteLine(BaseClass<Derived1>.WhatClassAmI); // "Derived1" Console.WriteLine(BaseClass<Derived2>.WhatClassAmI); // "Derived2" Console.Read(); } class BaseClass<T> where T : BaseClass<T> { public static string WhatClassAmI = "BaseClass"; } class Derived1 : BaseClass<Derived1> { } class Derived2 : BaseClass<Derived2> { } }
They use the "same" static, but each have their own values due to the type closure.