日期:2014-05-17 浏览次数:20860 次
class YourClass { int Num; List<string> Items } private YourClass Foo() { YourClass yc = new YourClass(); yc.Num = 0; yc.Items = new List<string>(); yc.Items.Add("abc"); return yc; }
------解决方案--------------------
第一种:
private List<T> Get(out int)
{}
第二种:
struct Test<T>
{
int A {get;set;}
List<T> List {get;set;}
}
private Test<T> Get()
{}