我的代码:
class Pattern
{
private Vector<Category>[] mCategories;
private class Category
{
// ...
}
public Pattern(int numCat)
{
mCategories = new Vector[numCat]; // <-- Here I get the warning
}
}
IntelliJ给我警告
“未选中的分配”:java.util.Vector []到'java.util.Vector
做到
mCategories = new Vector<>[numCat];
不仅无济于事,而且给我一个错误“无法推断参数”
那么我该如何解决呢?