I have an exam example which ask whether or not can I access the x variable containing the value 1? The solution is that I can, but I'm interested how exactly?
class A {
int x = 1; //this is what I need access to.
class B {
int x = 2;
void func(int x) {...}
}
}