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

Difference between string, stringbuffer and stringbuilder?

812


Can a constructor be protected?

785


What is a Null object?

1200


What are daemon Threads in java?

863


Why do we use return statement?

765


What are wrapped classes in java programming?

816


Explain the meaning of java applet.

831


What are meta-annotations?

733


Explain java coding standards for variables ?

879


Can constructor be inherited?

796


Can we define private and protected modifiers for the members in interfaces?

828


What is string pool?

823


What is java reflection?

751


Explain how can you debug the Java code?

825


What do you mean by compiler?

804