using System;
class MyBaseGenericClass {
protected T myObject;
public MyBaseGenericClass(T o) {
myObject = o;
}
public virtual T getmyObject() {
Console.Write("Base's getmyObject(): " );
return myObject;
}
}
class MyGenericClass : MyBaseGenericClass {
public MyGenericClass(T o) : base(o) { }
public override T getmyObject() {
Console.Write("overide getmyObject(): ");
return myObject;
}
}
class Test {
public static void Main() {
MyBaseGenericClass myObject = new MyBaseGenericClass(8);
Console.WriteLine(myObject.getmyObject());
myObject = new MyGenericClass(9);
Console.WriteLine(myObject.getmyObject());
}
}