我能转换List<int>成 List<List<int>>c#吗?当我使用这样的结构
List<int>element=new List<int>();
List<List<int>>superElement= new List<List<int>>(element);
Run Code Online (Sandbox Code Playgroud)
我弄错了,但我可以用另一种方式做到这一点吗?
我可以声明两个不同类型的属性,但在C#中具有相似的名称.像这样的东西:
public class Types
{
public string Element
{
get { return ""; }
}
public int Element
{
get { return 0; }
}
}
Run Code Online (Sandbox Code Playgroud)