In C#, why can't a List object be stored in a List<object> variable

前端 未结 14 1409
别跟我提以往
别跟我提以往 2020-11-22 03:42

It seems that a List object cannot be stored in a List variable in C#, and can\'t even be explicitly cast that way.

List sl = new List

        
14条回答
  •  别那么骄傲
    2020-11-22 04:25

    List sl = new List();
    List ol;
    ol = new List(sl);
    
        

    提交回复
    热议问题