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

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

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

    新的起點 新的開始

    快樂生活 !

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

             Jdeveloper 竟然報這樣的錯誤,而在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 報:
    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 閱讀(1931) 評論(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

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


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


    網(wǎng)站導(dǎo)航:
     

    公告

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

    統(tǒng)計

    常用鏈接

    留言簿(13)

    隨筆分類(71)

    隨筆檔案(179)

    文章檔案(13)

    新聞分類

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

    JAVA站點

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

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

    生活工作站點

    最新隨筆

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 亚欧洲精品在线视频免费观看| 亚洲中文精品久久久久久不卡| 污污视频网站免费观看| 全免费a级毛片免费看不卡| 亚洲色欲色欱wwW在线| 搡女人真爽免费视频大全| 亚洲一级大黄大色毛片| 蜜桃视频在线观看免费网址入口| 亚洲人成人网毛片在线播放| 欧美大尺寸SUV免费| 亚洲gay片在线gv网站| 亚洲?V无码乱码国产精品| 国产黄色片免费看| 香蕉视频在线观看亚洲| 中文字幕免费在线看线人| 国产成人精品亚洲2020| 国产网站免费观看| 99在线视频免费观看| 久久久久亚洲AV无码专区首JN| 小日子的在线观看免费| 在线综合亚洲中文精品| 四只虎免费永久观看| 久久性生大片免费观看性| 久久久国产精品亚洲一区| 18禁成年无码免费网站无遮挡| 无遮挡a级毛片免费看| 亚洲乱码国产一区三区| 四虎免费影院ww4164h| 久久精品国产亚洲AV| 亚洲午夜久久久影院伊人 | 亚洲国产成人精品青青草原| 成人免费视频试看120秒| 一级毛片免费一级直接观看| 亚洲AV成人片色在线观看高潮| 女性自慰aⅴ片高清免费| 一级午夜免费视频| 亚洲小说区图片区| 亚洲色欲久久久久综合网| 亚洲免费网站在线观看| 特级av毛片免费观看| 亚洲美女免费视频|