我懂 Java,然而我懵逼了= = – 热爱改变生活
我的GitHub GitHub |     登录
  • If you can't fly, then run; if you can't run, then walk; if you can't walk, then crawl
  • but whatever you do, you have to keep moving forward。
  • “你骗得了我有什么用,这是你自己的人生”
  • 曾有伤心之地,入梦如听 此歌

我懂 Java,然而我懵逼了= =

Java sinvader 5188℃ 0评论

各位不怕死的,来猜一下输出顺序

  1. public class MainClass {
  2.  
  3. public static void main(String[] args) {
  4. staticFunection();
  5. }
  6.  
  7. static MainClass st = new MainClass();
  8.  
  9. static {
  10. System.out.println("1");
  11. }
  12.  
  13. {
  14. System.out.println("2");
  15. }
  16.  
  17. public MainClass() {
  18. System.out.println("3");
  19. System.out.println("a =" + a + ", b=" + b);
  20. }
  21.  
  22. public static void staticFunection() {
  23. System.out.println("4");
  24. }
  25.  
  26. int a = 110;
  27. static int b = 112;
  28. }

原文:http://bbs.csdn.net/topics/391908395

输入你的预测结果 :

¥ 有帮助么?打赏一下~

转载请注明:热爱改变生活.cn » 我懂 Java,然而我懵逼了= =


本博客只要没有注明“转”,那么均为原创。 转载请注明链接:sumile.cn » 我懂 Java,然而我懵逼了= =

喜欢 (0)
发表我的评论
取消评论
表情

如需邮件形式接收回复,请注册登录

Hi,你需要填写昵称和邮箱~

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址