<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    悄悄成長
    for navigation

    2008年5月5日

    在ecliipse-->preference-->Java--->Debug 設置

    Suspend execution:
    只保留 suspend for breakpoint.

    Hot code replace
    保留: show error when hot code replace failed.
              show error when obsolete code remain after replace.
              replace classfiles containing compilation errors.

    Communication:
    change Debugger timer  to 30000
    Launch timer to 200000

    posted @ 2009-03-10 13:23 Duan Bo Hao 閱讀(435) | 評論 (0)編輯 收藏
     
    The project was not built since its build path is incomplete. The project was not built since its build path is incomplete. Fix the build path then try building this project
    The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files

    出現以上訊息的原因是因為你裝了多個版本的jre或jdk的關係。本來Eclipse在建立專案時,會自動參照你的jre路徑,但多個版本就沒辦法了。
    你只能手動建立…
    1. 進入window\preferences\java\Installed JREs
    1)按Add
    2)輸入JRE Name, 例JDK1.5.0.03
    3)JRE home directory, 選擇安裝的路徑
    4)按OK
    2. 進入Project\properties\Java Bulid Path
    1)Add library
    2)選JRE System Library後按Next
    3)選workplace default JRE後按finish...

    posted @ 2008-07-24 10:29 Duan Bo Hao 閱讀(3016) | 評論 (1)編輯 收藏
     

    I composed a code as below:

    package duanbo;

    public class HelloWorld
    {
            
    public static void main(String arg[])
            {
                System.out.println(
    "Hello World");
            }

    }

    The HelloWorld.java was put on root of E: , I excuse the compile/run process :
    E:\>javac HelloWorld.java

    E:\
    >java HelloWorld

    The first step was ok. And throw out "Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld (wrong name: duanbo/HelloWorld)" at step 2.

    I think may be I should move the HelloWorld.class to E:\duanbo. So did it.

    Redo the up steps. The erroe was same as before.

    After some search, I got the right command.

    E:\>javac HelloWorld.java

    E:\
    >java duanbo.HelloWorld


    posted @ 2008-05-05 14:05 Duan Bo Hao 閱讀(188) | 評論 (0)編輯 收藏
     

    You could add this parameter to find how java class loader work .

    javac -verbose classname.java
    java -verbose classname


    posted @ 2008-05-05 13:31 Duan Bo Hao 閱讀(216) | 評論 (0)編輯 收藏
     

    Under no circumstance, I think, you could speak that :" the java HelloWorld sample is easy."
    We could study a lot in this lesson.

    Let me demo the right code firstly.

    public class HelloWorld
    {
            
    public static void main(String arg[])
            {
                System.out.println(
    "Hello World");
            }

    }

    You should advance some questions about it, or you ...

    1. can the "public" keyword be skip?
    2. can we change the "String arg[]" parameter to "int arg[]"?
    3. does the "void" phrase could be put befor "static", as "public void static mian(String arg[])" ?
    4. could the "arg[]" be modified to other name ?

    Please find the answer to them with search engine.
    posted @ 2008-05-05 13:29 Duan Bo Hao 閱讀(216) | 評論 (0)編輯 收藏
     

    Study tha adapter pattern this morning. Found some tutorial are not as good as I imaged.

    I parse my code about the adapter to demo it.

    Firstly, the object adapter:

    package duanbo.patterns.adapter;

    public class ObjectAdapter
    {
        
    public static void main(String[] args){   
            PutBall pb 
    = new PutBall();   
               
            System.out.println(
    "BasketBall");   
            BasketballBag bb 
    = new BasketballBag();   
            pb.putBalls(bb);   
               
            System.out.println(
    "FootBall");
            FootballBag fb 
    = new FootballBag();   
            BallBag bbag 
    = new BallBag(fb);   
            pb.putBalls(bbag);   
        }

    }


    class BallBag extends BasketballBag
    {
        FootballBag fb;

        
    public BallBag(FootballBag fb)
        
    {
            
    this.fb = fb;
        }


        
    public void putball()
        
    {
            fb.putFootball();
        }

    }


    class BasketballBag
    {
        
    public void putball()
        
    {
            System.out.println(
    "Put in BasketBall.");
        }

    }


    class PutBall
    {
        
    public void putBalls(BasketballBag bb)
        
    {
            bb.putball();
        }

    }


    class FootballBag
    {
        
    public void putFootball()
        
    {
            System.out.println(
    "Put in FootBall.");
        }

    }

    And the second demo: Class Adapter:

    package duanbo.patterns.adapter;

    public class ClassAdapter extends RoundPeg implements ISquarePeg
    {
        
    private RoundPeg roundPeg;

        
    public ClassAdapter(RoundPeg peg)
        
    {
            
    this.roundPeg = peg;
        }


        
    public void insert(String str)
        
    {
            roundPeg.insertIntoHole(str);
        }


    }


    interface IRoundPeg
    {
        
    public void insertIntoHole(String msg);
    }


    interface ISquarePeg
    {
        
    public void insert(String str);
    }


    class SquarePeg implements ISquarePeg
    {
        
    public void insert(String str)
        
    {
            System.out.println(
    "SquarePeg insert():" + str);
        }

    }


    class RoundPeg implements IRoundPeg
    {
        
    public void insertIntoHole(String msg)
        
    {
            System.out.println(
    "RoundPeg insertIntoHole():" + msg);
        }

    }
    posted @ 2008-05-05 13:19 Duan Bo Hao 閱讀(269) | 評論 (0)編輯 收藏
     
    主站蜘蛛池模板: 性xxxxx免费视频播放| 久久精品视频免费看| 在线观看无码的免费网站| 亚洲午夜精品一区二区| 97无码人妻福利免费公开在线视频| 亚洲人片在线观看天堂无码| 亚洲视频免费观看| 亚洲a级在线观看| 九九久久国产精品免费热6| 亚洲Av无码国产情品久久 | 亚洲av无码一区二区三区乱子伦| h视频在线免费观看| 精品亚洲综合久久中文字幕| 亚洲国产高清国产拍精品| 午夜一级毛片免费视频| 噜噜综合亚洲AV中文无码| 国产成人无码a区在线观看视频免费 | 午夜网站免费版在线观看| 精品韩国亚洲av无码不卡区| 日韩午夜理论免费TV影院| 亚洲Av无码乱码在线观看性色| 永久免费无码日韩视频| 亚洲男同帅GAY片在线观看| 理论片在线观看免费| 77777亚洲午夜久久多人| 日本高清高色视频免费| 亚洲人成网男女大片在线播放| 日日AV拍夜夜添久久免费| 亚洲无成人网77777| 日韩精品视频免费观看| av午夜福利一片免费看久久| 亚洲av日韩av天堂影片精品| AV大片在线无码永久免费| 性色av极品无码专区亚洲| 亚洲人成人网站色www| 国产2021精品视频免费播放| 亚洲va在线va天堂va不卡下载| 美女裸身网站免费看免费网站| 免费视频成人国产精品网站 | 国产成人无码免费网站| 夜夜亚洲天天久久|