You are likely importing java.awt.List
.
You should instead import java.util.List
, which is a parameterized type.
More Related Contents:
- incompatible types required char found java.lang.string
- ArrayList, Loop and requisite if can not work that i want – Java 11
- How do I remove repeated elements from ArrayList?
- Arrays.asList() not working as it should?
- Array or List in Java. Which is faster?
- How to convert List to Map?
- How to remove duplicates from a list?
- stale element reference: element is not attached to the page document
- How to convert a Map to List in Java?
- How to make a new List in Java
- Package conflicts with automatic modules in Java 9
- Difference between Arrays.asList(array) and new ArrayList(Arrays.asList(array))
- Sorting a list with stream.sorted() in Java
- Java – generate Random range of specific numbers without duplication of those numbers – how to?
- How to compile a java source file which is encoded as “UTF-8”?
- Java Error: illegal start of expression
- How to get a reversed list view on a list in Java?
- intellij idea – Error: java: invalid source release 1.9
- Print array without brackets and commas
- ConcurrentModificationException thrown by sublist [duplicate]
- Why won’t my public void Constructor {} compile?
- javac : Compiling a .java file which uses other classes in it
- When to use a List over an Array in Java?
- Component for filtering a list
- Check if one list contains element from the other
- javac command line compile error: package javax.servlet does not exist
- Better practice to re-instantiate a List or invoke clear()
- Java 8: Reference to [method] is ambiguous [duplicate]
- Is LinkedList thread-safe when I’m accessing it with offer and poll exclusively?
- Get last element of Stream/List in a one-liner