How to create a property for a List

前端 未结 6 619
春和景丽
春和景丽 2020-12-13 00:32
private List newList;

public List NewList
{
get{return newList;}
set{newList = value;}
}

I want to create something like this, b

6条回答
  •  被撕碎了的回忆
    2020-12-13 01:10

    Either specify the type of T, or if you want to make it generic, you'll need to make the parent class generic.

    public class MyClass
    {
      etc
    

提交回复
热议问题