小编Myk*_*huk的帖子

将List <int>转换为List <List <int >>

我能转换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)

我弄错了,但我可以用另一种方式做到这一点吗?

.net c# collections list

5
推荐指数
4
解决办法
555
查看次数

在C#中声明两个具有不同类型但名称相似的属性

我可以声明两个不同类型的属性,但在C#中具有相似的名称.像这样的东西:

public class Types
{
    public string Element
        {
            get { return ""; }
        }
    public int Element
        {
            get { return 0; }
        }
}
Run Code Online (Sandbox Code Playgroud)

c# properties

-6
推荐指数
1
解决办法
2374
查看次数

标签 统计

c# ×2

.net ×1

collections ×1

list ×1

properties ×1