【发布时间】:2012-02-28 16:15:18
【问题描述】:
在下面的例子中,哪一个是最好的。如您所见,我仅使用列表集合,而没有使用命名空间中的其他任何内容。是这样的,当执行 Example1 时,命名空间 system.collections.generic 下的所有类都加载到内存中还是什么?两个示例的行为如何?
Example1:
using System.Collections.Generic;
public interface ICustomer
{
List<Customer> GetAll();
}
Example2:
public interface ICustomer
{
System.Collections.Generic.List<Customer> GetAll();
}
【问题讨论】: