error: type List does not take parameters

You are likely importing java.awt.List.

You should instead import java.util.List, which is a parameterized type.


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


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;