Using the generic type 'System.Collections.Generic.List<T>' requires 1 type arguments

旧城冷巷雨未停 提交于 2019-11-28 02:04:52

The List<T> class is a generic type.

In order to use it, you need to provide a type argument.

For example, if you want to have a list of integers, you need to declare it as List<int>, not List.

I guess you wrote something like List<List>> ...
But there is no class named List.. - List has a generic type parameter.
For example - list of lists of integers should be

List<List<int>> listOfLists = .....

For better understanding of C# generics take a look here.

I was able to just use using System.Collections.Generic; to get access to lists.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!