public abstract class class1 {
int h;
}
public class class2 extends class1{
int y;
}
import java.util.ArrayList;
import java.util.List;
class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
List<class1> test;
test = new ArrayList<class2>();
}
}
我遇到以下错误 错误:类型不兼容:ArrayList无法转换为List