早餐2塊2

          if(!java.isExist()) boss.fireOut(me);

          統計

          留言簿(1)

          積分與排名

          閱讀排行榜

          評論排行榜

          自己寫了一個比較變態的類,測試一下關于類初始化順序的知識~

          public class Outer {
              public Outer() {
                  System.out.print("a");
              }
              public static void sayOther(String s){
                  System.out.print(s);
              }
              public int say(String s){
                  System.out.print(s);
                  return 0;
              }
              {
                  System.out.print("c");
                  inner.innerMethed("d");
              }
              static
              {
                  System.out.print("e");
                  inner.innerMethed("f");
              }
              private int i=say("g");
              private static inner t= new inner();
              private inner tt=new inner();
              private innerOther ttt=new innerOther();
              static class inner{
                  public inner(){
                      System.out.print("h");
                  }
                  public static void innerMethed(String s){
                      System.out.print(s);
                  }
                  {
                      System.out.print("i");
                  }
                  static
                  {
                      System.out.print("j");
                  }
              }
              class innerOther{
                  public innerOther(){
                      System.out.print("k");
                  }
                  {
                      System.out.print("l");
                  }
              }
              public static void main(String[] args) {
                  System.out.print("m");
                  Outer outer = new Outer();
                  System.out.print("n");
              }
          }



          答案是:ejfihmcdgihlkan

          posted on 2006-02-11 02:03 早餐2塊2 閱讀(492) 評論(0)  編輯  收藏 所屬分類: java基礎

          主站蜘蛛池模板: 宁阳县| 广东省| 贵德县| 临洮县| 浮梁县| 沐川县| 方正县| 十堰市| 云南省| 青海省| 读书| 法库县| 金沙县| 铜川市| 保山市| 镇巴县| 合江县| 长岛县| 芜湖市| 如皋市| 花莲县| 天祝| 田东县| 阜南县| 北川| 登封市| 铁力市| 千阳县| 绥化市| 潮安县| 九龙城区| 芦山县| 特克斯县| 延吉市| 那曲县| 阿合奇县| 岱山县| 杨浦区| 章丘市| 仙居县| 嘉黎县|