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 is a treemap in java?

778


What does string intern() method do?

850


What happens if an exception is throws from an object's constructor?

902


describe method overloading

733


What method is used to specify a container's layout in java programming?

799


What is a boolean field?

742


How do you escape a string?

741


What is an arraylist in java?

736


Explain with example the concept of constant variable in java.

897


What is set string?

802


worst case complexities of Quick sort and Merge sort.

812


What is the difference between preemptive scheduling and time slicing in java programming?

802


What is the difference between static (class) method and instance method?

818


Can we declare the static variables and methods in an abstract class?

783


What is a “stateless” protocol ?

777