If i have a Inner class (not static) example:
public class A {
int myNumber = 100;
class B {
}
public static void main(String[] args) {
A outerObj = new A();
B innerObj = outerObj.new B();
System.out.println("i want the access to the variable
myNumber by the innerObject");
}
}
i mean:
i would like with the innerObject to reach the outerObject and see the variable myNumber.
I can do that just if i'm in a method of the B Class... but i would like everywhere to see the variabile of the outerObj by the inner.... it's possible?
if not why?
thanks