Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what is the difference between ArrayList and Vector

Answers were Sorted based on User's Feedback



what is the difference between ArrayList and Vector..

Answer / mohammed salim

1. Arraylist is not synchronized while vector is.
2. Arraylist has no default size while vector has a default
size of 10.

Is This Answer Correct ?    89 Yes 20 No

what is the difference between ArrayList and Vector..

Answer / m.sridhar

ArrayList and vector both are dynamically growing arrays.
ArrayList is not thread safe where as vector is thread safe.
vector is legacy class and ArrayList is newly added.
by default ArrayList capacity is 0 where as Vector intial
capacity is 10.
vector is growing by its size doubled.
ArrayList is increse by its size half(50%)

Is This Answer Correct ?    47 Yes 6 No

what is the difference between ArrayList and Vector..

Answer / harmeet

Arraylist is not synchronized where as Vector is
synchronized.
No default size for Arraylist where as Vector is having a
default size of 10.

Is This Answer Correct ?    58 Yes 19 No

what is the difference between ArrayList and Vector..

Answer / narasimha

i would like to add a new point to above answers.
we can specify the increment size with the vector and with
array list we cannot

Is This Answer Correct ?    37 Yes 5 No

what is the difference between ArrayList and Vector..

Answer / dara

ArrayList is non synchronized.Vector is
synchronized.ArrayList is very fast because non
synchronized.we can specify the increment size with the
vector and with arrayList we cannot

Is This Answer Correct ?    29 Yes 2 No

what is the difference between ArrayList and Vector..

Answer / devarathnam

Hi...
ArrayList is not synchronized(not Thread-safe)but Vector is
Synchronized(Thread-safe)
ArrayList gives u better performance than Vector

Is This Answer Correct ?    28 Yes 3 No

what is the difference between ArrayList and Vector..

Answer / bhushan singh

ArrayList is having only those method defined within its
collection class but in case of vector it is having its own
method which is not a part of its collection class.

Is This Answer Correct ?    18 Yes 4 No

what is the difference between ArrayList and Vector..

Answer / surya

for addition of 3rd answer incresing capacity in vector
using with ensureCapacity(int x) method

Is This Answer Correct ?    14 Yes 4 No

what is the difference between ArrayList and Vector..

Answer / thoi

Arraylist also has the initial capacity as 10.
Please check the following code in ArrayList class:

public ArrayList() {
this(10);
}

Is This Answer Correct ?    8 Yes 0 No

what is the difference between ArrayList and Vector..

Answer / vikas

1. Vector is synchronized while ArrayList is not.
2. Vector has default size is 10 while ArrayList has 10(Look
Java Class).
3. We can specify increment size with Vector.
4. If we use ensureCapacity(int minCapacity) to set the
default increment size then remember following things:
a. Vector v = new Vector();
b. V.capacity(); === output will be 10
c. If you try to set v.ensureCapacity(5),then
d. V.capacity(); ===10
e. If you try to set v.ensureCapacity( >20), then
f. V.capacity();===20 and
g. If you try to set v.ensureCapacity(21), then
h. V.capacity();===21, It clears that if set capacity over
20 then it will be set otherwise no.

Is This Answer Correct ?    8 Yes 0 No

Post New Answer

More Core Java Interview Questions

How do you escape sequences in java?

0 Answers  


Why stringbuilder is not thread safe in java?

0 Answers  


Is boolean a wrapper class in java?

0 Answers  


if i have one string class then how can you achive this class functionality of this class?

3 Answers   Fidelity, iFlex,


Write a program to find the greatest of three numbers in java?

0 Answers  


Name the types of mouse event listeners ?

2 Answers  


What are Font and FontMetrics classes?

1 Answers  


what is Thread priority?

4 Answers   Tech Mahindra, Wipro,


What is the purpose of javac exe?

0 Answers  


What java ide should I use?

0 Answers  


What state is a thread in when it is executing?

0 Answers  


Can you pass functions in java?

0 Answers  


Categories