当前位置: 代码迷 >> 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,该如何处理

热度:580   发布时间:2016-04-24 17:22:53.0
春节快乐!关于jdk5.0的Type safety: The cast from Object to HashMap<String,Object> is actually
代码   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> 类型,
怎么去除警告?

------解决方案--------------------
((HashMap <String, Object> ) reqMap).get( "User_Code ");
注意优先级别
  相关解决方案