Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么java在以下情况下返回java.util.LinkedHashMap。。。复杂的_Java_List_Generics_Collections_Casting - Fatal编程技术网

为什么java在以下情况下返回java.util.LinkedHashMap。。。复杂的

为什么java在以下情况下返回java.util.LinkedHashMap。。。复杂的,java,list,generics,collections,casting,Java,List,Generics,Collections,Casting,我的代码如下 @ResponseBody @RequestMapping(value ="/updateAll", method=RequestMethod.POST) public JSONObject update( @RequestBody List<T> list){ try{ T entity = list.get(0); System.out.println(entity.getClass()); dbSer

我的代码如下

@ResponseBody 
@RequestMapping(value ="/updateAll", method=RequestMethod.POST)  
public JSONObject update( @RequestBody List<T> list){ 
    try{
        T entity = list.get(0);
        System.out.println(entity.getClass());
        dbService.update(entityName + ".update", list);
        return jsonResult(null, null, null, 0);
    }catch(Exception ex){
        return jsonResult(null, null, ex, 0);
    }
}
这将准确地打印实体名称,没有任何问题

谁能解释一下为什么会这样?我在哪里可以了解更多关于这方面的信息

/**
 /**
     * Returns the runtime class of this {@code Object}. The returned
     * {@code Class} object is the object that is locked by {@code
     * static synchronized} methods of the represented class.
     *
     * <p><b>The actual result type is {@code Class<? extends |X|>}
     * where {@code |X|} is the erasure of the static type of the
     * expression on which {@code getClass} is called.</b> For
     * example, no cast is required in this code fragment:</p>
     *
     * <p>
public final native Class<?> getClass();
*返回此{@code对象}的运行时类。返回 *{@code Class}对象是由{@code锁定的对象 *表示的类的静态同步}方法。 * *实际的结果类型是{@code Class getClass();
不管引用类型是什么。方法
getClass()
返回
运行时类

 /**
     * Returns the runtime class of this {@code Object}. The returned
     * {@code Class} object is the object that is locked by {@code
     * static synchronized} methods of the represented class.
     *
     * <p><b>The actual result type is {@code Class<? extends |X|>}
     * where {@code |X|} is the erasure of the static type of the
     * expression on which {@code getClass} is called.</b> For
     * example, no cast is required in this code fragment:</p>
     *
     * <p>
public final native Class<?> getClass();