Debug调试多线程程序 代码示例 单例模式: 线程类 测试类 debug 运行测试类 以单例中的懒汉式做演示,展现多线程线程自主切换过程 代码示例 单例模式: public class LazySingleton { private LazySingleton() { } private static LazySingleton lazy = null; public static LazySingleton getInstance() { if (lazy == null) { // 设置断点 lazy = new LazySingleton(