Like it's name,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
//using Generics in a class
class tt<T>
{
public string add(T a,T b)
{
string c= a.ToString() + " " + b.ToString();
return c;
}
}
tt<int> t = new tt<int>();
string ret = t.add(3,4); //3 4
tt<double> t2 = new tt<double>();
string ret2 = t2.add(3,4.54); //3 4.54
tt<string> t3 = new tt<string>();
string ret3 = t3.add("orange","good"); //orange good