我收到来自日食的警告
Type safety: The expression of type TreeItem[] needs unchecked conversion to conform to TreeItem<AppleItem>[]
在使用这个时:
TreeItem<AppleItem>[] friends = item.getChildren().toArray(new TreeItem[0]);
我不想使用@uncheck或者我不想使用循环来一一插入。有没有办法做到这一点?
显然getChildren返回一个ArrayList喜欢ArrayList<TreeItem<AppleItem>>
提前致谢。