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

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

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

    新的起點(diǎn) 新的開始

    快樂生活 !

    Oracle的IDE-Jdeveloper 竟然有如此搞笑的錯誤信息,而在Eclipse 命令行OK, 那位使用Jdveloper10的朋友解釋一下!

             Jdeveloper 竟然報(bào)這樣的錯誤,而在Eclipse 及通過命令行可以執(zhí)行成功,不知道為什么,那位朋友使用Jdeveloper 幫我看看,呵呵,指不定就是Jdevloper一個Bug。
            這段代碼如下:




    public class TreeClient {
        
    public static <T> String toString(Tree<T> t){
           
    return  t.visit(new Tree.Visitor<T,String>(){
               
    public String leaf(T e){
               
    return e.toString();
               }

               
    public String branch(String l,String r){
               
    return l.toString()+r.toString();
               }

           }
    );
        }

        
    public static <extends Number> Double sum(Tree<N> t){
            
    return t.visit(new Tree.Visitor<N,Double>(){
                 
    public Double leaf(N e){
                 
    return e.doubleValue();
                 }

                 
    public Double branch(Double l,Double r){
                 
    return l+r;
                 }

                    }
    );

        }

        
        
    public static void main(String[] args){
            Tree
    <Integer> t =Tree.branch(Tree.branch(Tree.leaf(1),Tree.leaf(2)),Tree.leaf(3));
            System.out.println(t.toString());
            System.out.println(sum(t));
        }

    }

    abstract class Tree<E> {

        
    public interface Visitor<E,R>{
            
    public R leaf(E elt);
            
    public R branch(R left,  R righ );
        }


        
    public abstract <R> R visit(Visitor<E,R> v);
        
        
    public static <T> Tree<T> leaf(final T e){
            
    return new Tree<T>(){


                    
    public <R> R visit(Visitor<T,R> v) {
                        
    return v.leaf(e);
                    }

                }
    ;
        }

        
    public static <T> Tree<T> branch(final Tree<T> i,final Tree<T> r){
            
    return new Tree<T>(){

                    
    public <R> R visit(Visitor<T,R> v) {
                        
    return v.branch(i.visit(v),r.visit(v));
                    }

                }
    ;

        }

    }
         Jdeveloper10 報(bào):
    Error(48,30): method visit(citi.Tree.Visitor<T,R>) in anonymous class cannot override method visit(citi.Tree.Visitor<E,R>) in class citi.Tree with different return type, was
     Error(56,30): method visit(citi.Tree.Visitor<T,R>) in anonymous class cannot override method visit(citi.Tree.Visitor<E,R>) in class citi.Tree with different return type, was

    下圖所示:


    而Eclipse 和命令行都能得到正確的結(jié)果 如下圖:

      

          那位使用Jdeveloper的朋友解釋一下原因? 我使用的是jdevstudio10132  JDK是Sun 1.5
      

    posted on 2009-04-14 21:16 advincenting 閱讀(1937) 評論(2)  編輯  收藏

    評論

    # re: Oracle的IDE-Jdeveloper 竟然有如此搞笑的錯誤信息,而在Eclipse 命令行OK, 那位使用Jdveloper10的朋友解釋一下! 2009-04-14 22:15 逝水fox

    建議說一下 你的48行和56行代碼是什么
    錯誤顯示是這兩行有問題 偏偏JD代碼又只截圖到30行 Eclipse樓主又不開行標(biāo) Blog的代碼也沒有行標(biāo)

    連錯得到底是哪一行都不知道 是很難分析的咯  回復(fù)  更多評論   

    # re: Oracle的IDE-Jdeveloper 竟然有如此搞笑的錯誤信息,而在Eclipse 命令行OK, 那位使用Jdveloper10的朋友解釋一下! 2009-04-15 09:24 advincenting

    代碼拷貝過去試著運(yùn)行一下么   回復(fù)  更多評論   


    只有注冊用戶登錄后才能發(fā)表評論。


    網(wǎng)站導(dǎo)航:
    博客園   IT新聞   Chat2DB   C++博客   博問  
     

    公告

    Locations of visitors to this pageBlogJava
  • 首頁
  • 新隨筆
  • 聯(lián)系
  • 聚合
  • 管理
  • <2009年4月>
    2930311234
    567891011
    12131415161718
    19202122232425
    262728293012
    3456789

    統(tǒng)計(jì)

    常用鏈接

    留言簿(13)

    隨筆分類(71)

    隨筆檔案(179)

    文章檔案(13)

    新聞分類

    IT人的英語學(xué)習(xí)網(wǎng)站

    JAVA站點(diǎn)

    優(yōu)秀個人博客鏈接

    官網(wǎng)學(xué)習(xí)站點(diǎn)

    生活工作站點(diǎn)

    最新隨筆

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 毛片a级三毛片免费播放| 无码一区二区三区免费| 日韩视频在线免费观看| 亚洲成人动漫在线观看| 在线观看www日本免费网站| 亚洲综合视频在线| 16女性下面无遮挡免费| 亚洲色偷偷av男人的天堂| 69av免费视频| 亚洲色少妇熟女11p| 国产片AV片永久免费观看| 日本亚洲免费无线码 | 男人进去女人爽免费视频国产| 中文字幕人成人乱码亚洲电影| 成年网站免费入口在线观看| 亚洲欧洲国产成人综合在线观看 | 亚洲爽爽一区二区三区| a级毛片免费网站| 国产AV无码专区亚洲精品| 91麻豆国产免费观看| 亚洲天堂一区二区三区| 成熟女人特级毛片www免费| 美女黄网站人色视频免费| 国产亚洲精久久久久久无码77777| 国产在线观看免费视频软件| 亚洲制服中文字幕第一区| 成年女人毛片免费播放人| 免费的黄网站男人的天堂| 久久精品国产亚洲网站| 日本一区二区三区免费高清| 色网站在线免费观看| 亚洲产国偷V产偷V自拍色戒| 我的小后妈韩剧在线看免费高清版| 亚洲人成网站999久久久综合| 亚洲精品视频久久久| 日本免费人成视频在线观看| 亚洲日韩国产精品乱-久| 国产亚洲色视频在线| 999国内精品永久免费视频| 男人和女人高潮免费网站| 亚洲一区精品中文字幕|