class Gen {
T ob; // declare an object of type T
Gen(T o) {
ob = o;
}
// Return ob.
T getob() {
return ob;
}
}
// A subclass of Gen that defines a second type parameter, called V.
class Gen2 extends Gen {
V ob2;
Gen2(T o, V o2) {
super(o);
ob2 = o2;
}
V getob2() {
return ob2;
}
}
class HierDemo {
public static void main(String args[]) {
Gen2 x = new Gen2("Value is: ", 99);
System.out.print(x.getob());
System.out.println(x.getob2());
}
}