public class TestList<T>
{
public void Add(T input) { }
}
class TestGList
{
private class Example1 { }
static void Main()
{
// Declare a list of type int.
TestList<int> list1 = new TestList<int>();
list1.Add(1);
// Declare a list of type string.
TestList<string> list2 = new TestList<string>();
list2.Add("");
// Declare a list of type Example1.
TestList<Example1> list3 = new TestList<Example1>();
list3.Add(new Example1());
}
}
No comments:
Post a Comment