This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Originally posted by Ulf Dittmer: No. But they both extend AbstractList, so you can typecast to that.
True, but note that AbstractList's public methods are precisely the same as List's, so I would more likely write:
On the other hand, I think the OP wanted to *cast* ("convert*) an existing ArrayList to a Vector: you can't do that, but you can create a new Vector that holds copies of the references found in the ArrayList:
Note that v != arrayList, although v.equals(arrayList).
Of course, in the best of all possible worlds, just being of type List should suffice!