Advertisement

第十四题的输出结果是什么?

阅读量:

第十四题:

以下代码的输出结果是?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 public class B { ``public static B t1 = ``new B(); ``public static B t2 = ``new B(); ``{ ``System.out.println(``"构造块"``); ``} ``static ``{ ``System.out.println(``"静态块"``); ``} ``public static void main(String[] args) ``{ ``B t = ``new B(); ``} }
复制代码
复制代码
复制代码
复制代码

懵逼树上懵逼果,懵逼树下你和我

首先看到这道题,我就想着那不是先静态代码块先执行吗

话不多说,直接跑代码

复制代码
 public class B

    
  
    
 {
    
  
    
     public static B t1 = new B();
    
  
    
     public static B t2

全部评论 (0)

还没有任何评论哟~