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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What are constants and how to create constants in java?

986


If a method is declared as protected, where may the method be accessed?

1016


What do you mean by collectors in java 8?

935


What is difference between public static and void?

1020


What is method in java ?

1085


Give differences between Quicksort &Mergesort. When should these sorts be used andwhat is their running time in java?

1243


Are strings immutable in java?

985


What is skeleton and stub?

1089


Is void a wrapper class?

948


What are the two types of exceptions in java? Which are the differences between them?

1100


What is meant by final class?

1118


What is computer compiler?

1001


What is private static class in java?

1017


Explain which of the following methods releases the lock when yield(), join(),sleep(),wait(),notify(), notifyall() methods are executed?

1119


What is reflexive association?

1804