public static void main(String[] args) { Holder3<Automobile> h3 = new Holder3<Automobile>(new Automobile()); Automobile a = h3.get(); // No cast needed // h3.set("Not an Automobile"); // Error // h3.set(1); // error }
public static void main(String[] args) { Holder3<String> h3 = new Holder3<String>("test"); String str = h3.get(); }