代码
import java.util.ArrayList;
import java.util.Spliterator;
public class HelloWorld {
public static void main(String[] args) {
ArrayList<String> list1 = new ArrayList<>();
}
}
跟着视频操作的没问题,但是我的new ArrayList<>();会报错,报错内容如下:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Type mismatch: cannot convert from ArrayList<?> to ArrayList<String>
Cannot instantiate the type ArrayList<?>
Syntax error on token "<", ? expected after this token
at HelloWorld.main(HelloWorld.java:6)
还请大家帮忙看看是什么问题