what is the diff b/w arraylist and vector?

Answer Posted / srikanth reddy

Vector and ArrayList are very similar. Both of them
represent a 'growable array'

arraylist class is added in java/j2ee where has vector class
is before to jdk1.4 they just taken as it as in jdk1.4

the main difference is that Vector it's a synchronized
object, while ArrayList it's not.

for accesing elements of arraylist we can use iterator

for accesing elements of vectorlist we can use both iterator
and enumeraation

arraylist is faster in acessing of elements compared to
vector class

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are assembly attributes?

548


What is cr keyboard?

659


When should you use arraylist and when should you use linkedlist?

496


What is generics in java interview questions?

541


What will happen to the exception object after exception handling?

579






what is bmg file and how to create that files?what will it contailn?

1892


Is java a virus?

535


What are different ways of object creation in java ?

579


State differences between C and Java?

666


Are true and false keywords?

578


Can list be final in java?

489


What are predefined functions?

579


What is the argument in java?

497


What is array length?

507


Can a class extends itself in java?

531