IllegalStateException: No primary or single unique constructor found for interface java.util.List
时间: 2023-11-25 20:42:19 浏览: 213
在Java中,当你在创建一个接口类型的List对象时,会出现"java.lang.IllegalStateException: No primary or single unique constructor found for interface java.util.List"的异常。这是因为List是一个接口,它没有自己的构造函数。你需要使用List的一个具体实现类,如ArrayList或LinkedList,来创建List对象。
阅读全文
相关推荐













