File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Reg. Vector Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Reg. Vector " Watch "Reg. Vector " New topic
Author

Reg. Vector

Angela Narain
Ranch Hand

Joined: Apr 14, 2001
Posts: 327
Does a Vector contain elements in sorted order?
It is an implementation of the List interface which
allows duplicate elements in sorted order.
Desai Sandeep
Ranch Hand

Joined: Apr 02, 2001
Posts: 1157
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>
Guoqiao Sun
Ranch Hand

Joined: Jul 18, 2001
Posts: 317
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
Jennifer Warren
Ranch Hand

Joined: Aug 24, 2001
Posts: 53
please confirm who is right as now i'm confused.
thanks
Jennifer
------------------
Gurpreet Sachdeva
Ranch Hand

Joined: Feb 20, 2001
Posts: 90
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>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reg. Vector
 
Similar Threads
Collections.binarySearch() Problem
Collections question
TreeSet
How do I search this Vector or String ?
java Collections