import java.util.Vector; class MyClass { } public class MainClass { public static void main(String[] argv) { Vector v = new Vector(); v.add(new MyClass()); MyClass a = (MyClass) v.elementAt(0); } }