List to varargs java

Tôi đã đặt Netbeans để hiển thị cảnh báo chưa được kiểm tra trong mã Java của mình, nhưng tôi không hiểu lỗi trên các dòng sau:

private List cocNumbers; private List vatNumbers; private List ibans; private List banks; ... List combinations = Utils.createCombinations[cocNumbers, vatNumbers, ibans];

Cung cấp:

[unchecked] unchecked generic array creation for varargs parameter of type List[]

Nguồn phương pháp:

/** * Returns a list of all possible combinations of the entered array of lists. * * Example: [["A", "B"], ["0", "1", "2"]] * Returns: [["A", "0"], ["A", "1"], ["A", "2"], ["B", "0"], ["B", "1"], ["B", "2"]] * * @param The type parameter * @param elements An array of lists * @return All possible combinations of the entered lists */ public static List createCombinations[List... elements] { List returnLists = new ArrayList[]; int[] indices = new int[elements.length]; for [int i = 0; i

Chủ Đề