class Gen {
T ob; // declare an object of type T
Gen(T o) {
ob = o;
}
T getob() {
return ob;
}
}
class RawDemo {
public static void main(String args[]) {
Gen iOb = new Gen(88);
Gen strOb = new Gen("Generics Test");
Gen raw = new Gen(new Double(98.6));
double d = (Double) raw.getob();
System.out.println("value: " + d);
strOb = raw; // OK, but potentially wrong
raw = iOb; // OK, but potentially wrong
}
}