![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Collections.Specialized;
using System.Threading;
using System.Reflection;
using System.Data;
namespace TestArray
{
class Program
{
static void Main(string[] args)
{
Genericer<MyCls> MyGen = new Genericer<MyCls>();
Console.WriteLine(MyGen.GetItem().Name);
Console.ReadLine();
}
}
class Genericer<T> where T : new()
{
public T GetItem()
{
return new T();
}
}
class MyCls
{
private string _name;
public string Name
{
get { return _name; }
set { _name = value; }
}
public MyCls()
{
_name = "Emma";
}
}
}