Cannot assign LinkedList to list, why?

I use Java in Eclipse on Mac OS X 10.5 (JDK 5.0 compliance level), and I am having very strange compilation problems that I didn’t get before (and I don’t think I updated my compiler or Eclipse, but maybe an update was installed that I did not know about). For example, if there is the following line in my code:

List foo = new LinkedList();

I get a warning saying:

Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
Type mismatch: cannot convert from LinkedList to List

Does anyone know what happened?

thanks

+5
source share
1 answer

, List Eclipse . java.awt.List, java.util.List, LinkedList , , .

+12

All Articles