A
Alex Leduc
I'd like to know how one shares an int variable across different ocjects
(of different classes) without pointers.
public class ClassA {
public int n;
public ClassA(int N) {
n = ???
n++;
}
}
public class ClassB {
public int n = 0;
public ClassA = new ClassA(n);
}
If I increment n in the instance of ClassA, I would like the parent
ClassB's instance to have it's "n" varable to have the same value.
Alex
(of different classes) without pointers.
public class ClassA {
public int n;
public ClassA(int N) {
n = ???
n++;
}
}
public class ClassB {
public int n = 0;
public ClassA = new ClassA(n);
}
If I increment n in the instance of ClassA, I would like the parent
ClassB's instance to have it's "n" varable to have the same value.
Alex