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)
<b>Sandeep</b> <br /> <br /><b>Sun Certified Programmer for Java 2 Platform</b><br /> <br /><b>Oracle Certified Solution Developer - JDeveloper</b><br /><b>-- Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java </b><br /><b>-- Object-Oriented Analysis and Design with UML</b><br /> <br /><b>Oracle Certified Enterprise Developer - Oracle Internet Platform</b><br /><b>-- Enterprise Connectivity with J2EE </b><br /><b>-- Enterprise Development on the Oracle Internet Platform </b>
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>