
董鹏的回答:
引用命名空间: using System.Collections; 不行哈,ArrayList是System.Collections下的一个类型,而不是System.Collections.Generic下的,如果你不引用可以直接这么写: System.Collections.ArrayList = new System.Collections.ArrayList(arr); 上面得也是对的 用using System.Collections.Generic就没有把ArrayList这个类型引用进去,会报错
陈子良的回答:
引用命名空间: using System.Collections; 不行哈,ArrayList是System.Collections下的一个类型,而不是System.Collections.Generic下的,如果你不引用可以直接这么写: System.Collections.ArrayList = new System.Collections.ArrayList(arr); 上面得也是对的 用using System.Collections.Generic就没有把ArrayList这个类型引用进去,会报错
刘老大的回答:
using system.collections;
张玉平的回答: