您的位置:程序门 -> java -> j2se / 基础类



春节快乐!关于jdk5.0的type safety: the cast from object to hashmap<string,object> is actually


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


春节快乐!关于jdk5.0的type safety: the cast from object to hashmap<string,object> is actually[已结贴,结贴人:censoft66]
发表于:2007-02-16 23:02:31 楼主
代码   return   (hashmap <string,   object> )   reqmap.get( "user_code ");

出现   type   safety:   the   cast   from   object   to   hashmap <string,object>   is   actually   checking   against   the   erased   type   hashmap

reqmap也是hashmap <string,   object> 类型,
怎么去除警告?
发表于:2007-02-16 23:18:081楼 得分:40
((hashmap <string,   object> )   reqmap).get( "user_code ");
注意优先级别
发表于:2007-02-16 23:29:212楼 得分:0
呵呵,太多修饰
发表于:2007-02-18 12:50:293楼 得分:0
非常感谢您的回复:但如下该如何处理?

hashmap <string,   object>   nap   =   (hashmap <string,   object> )entitybean.getusermap().clone();

用hashmap <string,   object>   nap   =   ((hashmap <string,   object> )entitybean.getusermap()).clone();依然有警告信息?
发表于:2007-02-18 13:57:434楼 得分:0

    高手呢??
发表于:2007-02-18 22:12:025楼 得分:0
?????????????????????
发表于:2007-02-19 12:04:446楼 得分:0
人泥?
发表于:2007-02-22 10:45:447楼 得分:0
还没有答案


快速检索

最新资讯
热门点击