do u know the difference between ArrayList & vector?
try to find it out.
Joined: Mar 28, 2005
Hi Sajid, ArrayList is part of Collection framework and Vector represents the earlier version of JDK. Both of them represent growable array using the index. For traversing ArrayList uses Iterator interface while Vector makes use of Enumerator interface. I presume this can satisfy you. if not convey to me. I will try to answer for you.
Hi, The main Difference between ArrayList and Vector is: 1] All the methods of ArrayList by default not "syncronized".Where all the methods of Vector are "syncronized". 2]But ArrayList also provides a way to make it's method syncronized if required. So Using ArrayList makes the program more faster than using Vector.The reason is syncronized method impacts the performance of program.If you are not concerned with Thread's then it is best to use ArrayList than Vector.
I thnk for the purpose of the exam you only need to kno when to use them i.e which collection would most satisfy a particular set of conditions..ie which wud provide unique elements ,key value pairs etc..these it self an be tricky at times but are mostly easy. In majority of the mock tests that is what is covered but the khalid mughal gives a lot more information..If you have the time do go thru it. Also give the test at javacertificate.com there are a lot of questions on collection implemention there if you want to get scared and start studying the chapter all over again.. But I thnk you should wait for a reply from someone Higher up the Ladder.
Vector exists for reverse compatibility. Vector has not been formally deprecated because several core APIs depend on it. Vector should only be used in obscure scenarios; specifically, where you are supporting JRE 1.1 or you depend on some old or broken core or third party API where it is required. http://www.xdweb.net/~dibblego/java/faq/answers.html#q35