I get the following error despite it's exactly one used in examples:
error: type List does not take parameters
List<String> strings_wat = new ArrayList<String>();
Java is version 1.7 and the class is NOT named ArrayList
.
I get the following error despite it's exactly one used in examples:
error: type List does not take parameters
List<String> strings_wat = new ArrayList<String>();
Java is version 1.7 and the class is NOT named ArrayList
.
Likely you are importing java.awt.List
instead of java.util.List
It seems like you are importing it from java.awt
:
import java.awt.List;
and it looks like you want to use the one from java.util
:
import java.util.List;
if you are working on Graphical user interface you have to
import java.awt.List
instead of import java.util.List
Other then else if you are working on simple code you have to import java.util.List;
instead of import java.awt.List