早餐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基礎

          主站蜘蛛池模板: 哈巴河县| 马公市| 白玉县| 教育| 广德县| 内丘县| 高邮市| 宜都市| 贵德县| 金山区| 白山市| 启东市| 余江县| 鸡西市| 定远县| 万荣县| 康平县| 潮安县| 东源县| 定南县| 鞍山市| 弥勒县| 长汀县| 武安市| 米易县| 尚义县| 临湘市| 磐安县| 那曲县| 司法| 惠安县| 九寨沟县| 江永县| 边坝县| 秦皇岛市| 镇江市| 通河县| 准格尔旗| 新建县| 平湖市| 涞源县|