I have the following situation:
class A {
static int a, aa;
A(int x, int y) {
a = x;
aa = y;
}
}
class B extends A {
B() {
super(2, 3);
}
}
class C extends A {
C() {
super(3, 4);
}
}
class Test {
public static void main(String[] args) {
B b = new B();
C c = new C();
}
}
Of course, now B.a
is 3 and B.aa
is 4.
How could I change B
and C
so that a
and aa
remain static, are still inherited from A
, but can have a set of values for B
and another set for C
?