8.22.3.Arguments of all add() calls made on myVec must be of type MyClass or subclasses of MyClass.
import java.util.Vector;
public class MainClass { public static void main(String[] argv) {
Vector<MyClass> myVec;
myVec = new Vector<MyClass>();
MyClass myClass = new MyClass();
myVec.add(myClass);
MySubclass sub = new MySubclass();
myVec.add(sub);