Cannot instantiate the type List
记录一下出现得问题
在使用java.util.List; 的时候,把语句写成了:List arr = new List();导致错误:Cannot instantiate the type List正确写法是:List arr = new ArrayList();2
转载大佬得博客心里突突的
————————————————
版权声明:本文为优快云博主「微wx笑」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.youkuaiyun.com/testcs_dn/article/details/38459211
Cannot instantiate the type List
最新推荐文章于 2023-04-06 08:58:58 发布
本文解析了在Java中尝试直接实例化List接口而非具体实现类(如ArrayList)时遇到的常见错误“Cannot instantiate the type List”。通过一个简单的示例说明了正确的List实例化方法。
901

被折叠的 条评论
为什么被折叠?



