Java知识点 12345678910111213141516 public class { public static B b1 = new B(); public static B b2 = new B(); { System.out.print("构造块"); } static { System.out.print("静态块"); } public static void main(String[] args) { B b = new B(); }}//输出结果:构造块构造块静态块构造块 赞微海报分享
近期评论