NOTE: I’m not talking about the way of accessing the enclosing class FROM the inner class, that is not the problem at all. What I’m talking about is the following:
class TopLevel {
class InnerClass {
}
}
// in some other class A.java
public void execute(InnerClass ic) {
}
Here, in the execute()
method, we have the instance of the InnerClass
passed as an argument. So what I actually want is to access the instance of Enclosing
class, inside which the InnerClass
instances that was passed to execute()
was created.
How can this be achieved?
You need to sign in to view this answers