posted 21 years ago
Not sure what you mean. If you added a method to the Tester
class, you could retrieve the relevant variable, e.g.
---------------------
void changeVal() {
q.protectedVar = 2;
}
----------------------
That would change the value of that variable, because it was declared in class Q, and q has access to it.
There's no way to call someMethod() though, I don't think, because you can't cast q to the anonymous class.
Not sure what your question is, so sorry if I'm failing to address it.