Inconvertible types; cannot cast 'int' to '
public static <K,V> Map<K, V> newMapT(V... objects) {
Map<K, V> map = new HashMap<>();
for (V object : objects) {
map.put((K)1, object);
}
return map;
}
解决方法:
map.put((K)new Integer(1), object);