We know a Class is usually been loaded into meta space, but what about an nonstatic inner class? where it goes when it has been loaded?
class OuterClass {
/**
* Where is this class? would this class goes to the meta space?
*/
class InnerClass{
public void method(){
/**
* And where is this class?
*/
class InnerClassInMethod{
public void method(){
System.out.println("Hello");
}
}
new LocalClass().method();
}
}
}
And when the class would be loaded? it would be loaded as well as the outer class or deferred until an instance has been requested? And, same question for they are going to be unloaded?