static inheritance

Oct 15 2009 6:26 AM
Hi, just a quick question about static inheritance: Suppose I have this code: /// abstract Class A { public static int myVar; } Class B : A { } Class C : A { } /// I understand that the static variable myVar in A, B and C is the same instance in all 3 classes, so if I change it in one class, it will also change in all the other classes. Is there any way to make them separate but keep them static in each class without declaring them in the derived classes? Thanks

Answers (2)