T
Tony Johansson
Hello!
Assume you have three classes.
At the top you have a class called Base which is an abstract class.
In this Base class is there for example one static int.called number
Just below this Base class you have two derived classes called Derived_1 and
Derived_2.
Now to my question this class variable number does all classes in this case
the Base class, Derived_1 and Derived_2
share this variable?
So if you create 3 object of class Derived_1 and 3 object of class Derived_2
you still have only one instance of this variable number that all 6 object
will share. Is that correct ?
Many thanks.
//Tony
Assume you have three classes.
At the top you have a class called Base which is an abstract class.
In this Base class is there for example one static int.called number
Just below this Base class you have two derived classes called Derived_1 and
Derived_2.
Now to my question this class variable number does all classes in this case
the Base class, Derived_1 and Derived_2
share this variable?
So if you create 3 object of class Derived_1 and 3 object of class Derived_2
you still have only one instance of this variable number that all 6 object
will share. Is that correct ?
Many thanks.
//Tony