更新时间: 2018-03-03 12:08:15#java list坑static void test(List<String>... stringLists) { Object[] array = stringLists; //变量指向 stringLists List<Integer> tmpList = Arrays.asList(42); array[0] = tmpList; // Semantically invalid, but compiles without warnings //这里 stringlist 已经变成 tmpList 了 String s = stringLists[0].get(0); // Oh no, ClassCastException at runtime! 实际是42 // java.lang.Integer cannot be cast to java.lang.String System.out.println(s);// 错误 }