本文可作为北京圣思元深入java虚拟机的课堂笔记. 先看一个令人dan teng的面试题 public class Singleton { public static Singleton s=new Singleton(); public static int k1; public static int k2=0; private Singleton(){ k1++; k2++; } public static void main(String[] args) { System.out.prin…