且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

有什么问题:LinkedList< String> stringList = new LinkedList< String>();

更新时间:2023-01-19 20:19:00

检查以确保你没有一个名为 LinkedList 在同一目录中。 (特别是因为链表是一个常用术语,人们经常尝试将其作为初学者来实现。)如果你使用类似 import java.util。*的东西导入类,这一点非常重要。 ,因为 * 按需导入,所以如果包中已经有一个同名的类,那么使用该类并且 java.util.LinkedList 未导入。

Check to make sure you don't have a compiled class named LinkedList in the same directory. (Especially since "linked list" is a common term, and it is something that people often try to implement as beginners.) This is important if you import your classes using something like import java.util.*;, because the * imports on-demand, so if there is a class with the same name in the package already, then that class is used and the java.util.LinkedList is not imported.