Kacper Szmigiel wrote:OK, I'vegot it. ClassB just extends ClassA
You shouldn't be doing that just to get access to class A's members.
You should only do that if a B IS-A special type of A.
and ObjectA is declarated as ClassA's variable.
So you've got this?
If so, that looks very wrong, though it's hard to give concrete advice on how to improve it without a more concrete picture of what you're trying to model and what you want to do with it.