using System;
class MyGenericClass<T> {
T ob;
public MyGenericClass(T o) {
ob = o;
}
public T getob() {
return ob;
}
publicvoid showType() {
Console.WriteLine("Type of T is " + typeof(T));
}
}
publicclass Test {
publicstaticvoid Main() {
MyGenericClass<int> iOb;
iOb = new MyGenericClass<int>(102);
iOb.showType();
int v = iOb.getob();
Console.WriteLine("value: " + v);
MyGenericClass<string> strOb = new MyGenericClass<string>("Generics add power.");
strOb.showType();
string str = strOb.getob();
Console.WriteLine("value: " + str);
}
}