how should I use .getClass() ?
adding objects to a Vector, I'd like to retreive them with the correct original class type :
Vector v = new Vector();
User visitor = new User(1,"joe");
History hist = new History(1);
v.addElement(visitor);
v.addElement(hist);
Object oVisitor = v.elementAt(0);
Object oHist = v.elementAt(1);
// of course here I know the class, but I want to guess before cast :
(oVisitor.getClass().getName())oVisitor.aMethodInUser();
// doesn't work.
may be I should eval() the last code line but I don't know if it's possible in Java ?
anyone a better idea?
thanks for your help.
Laurent.

