Hi Anjela, Yes, the Vector will contain the elements in a sorted order.This is because the Vector implements the responsibility of the List interface, which maintains the ordered sequence of elements. Hope this helps, Sandeep SCJP2, OCSD(Oracle JDeveloper), OCED(Oracle Internet Platform)
Hi, Angela, Vector does not contain element in sorted order. Only class implementing SortedMap or SortedSet contain element in sorted order. But Vector contains element in ordered way, which means you can access the element through index of position.
------------------ Guoqiao Sun Sun Certified Programmer for Java 2 Platform Try my mock exam¹ at my homepage.
Guoqiao Sun<br />SCJP2 SCWCD2<br />Creator of <a href="http://www.jiris.com/" target="_blank" rel="nofollow">www.jiris.com</a>, Java resource, mock exam, forum
Hello All, Guoqiao is right vector does not contain elements in sorted order. Sandeep, sorted way is different from ordered way. As Guoqiao said Ordered way only means that you can access the element through index of position. It has no relation with sorting. The best way is to try some code. Regards Gurpreet Sachdeva For Mock Exams FAQ and some useful information about Bitshift operator, inner classes, garbage collection,etc please visit: http://www.go4java.20m.com
[This message has been edited by Gurpreet Sachdeva (edited September 04, 2001).]
Regards<BR>Gurpreet Sachdeva<P>For Mock Exams, FAQ, Exam tips and some useful information about Bitshift operator, inner classes, garbage collection,etc please visit: <A HREF="http://www.go4java.lookscool.com" TARGET=_blank rel="nofollow">http://www.go4java.lookscool.com</A>