我正在玩一些静态嵌套类。
package com.tutorial;
public class MyUpperClass {
private MyUpperClass () {
}
private static class MyStaticInnerClass{
private static final MyUpperClass muc = new MyUpperClass ();
}
public static MyUpperClass getInstance() {
return MyStaticInnerClass.muc;
}
}
MystaticInnerClass
何时加载到JVM内存中?
当MyUpperClass
加载或getInstance()
被调用时?