public static void main(String[] args) {
ArrayList<Integer> integers = new ArrayList<>();
ArrayList<Object> objects = (ArrayList) integers; // 编译通过
ArrayList<Object> objects = (ArrayList<Object>) integers; // 编译失败
}
请问为什么强转不带泛型编译通过,带上泛型反而还失败了?谢谢!