Static inheritance
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
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

jingeRank #2,527 · 554 reputationPosted Oct 15, 2009, 2:35 AM EDT
Do not try to break the rules of the OOP.
Chris Schinkoethe3 reputationPosted Oct 15, 2009, 2:36 AM EDT