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

Can a constructor be protected?

1029


What does it mean to flush a file?

1004


What is the difference between member variables initialization and assignment in a constructor?

1174


What are inbuilt functions?

935


What occurs when an object is constructed?

937


How will you compute size of a structure?

1073


What is a ternary operator in java?

941


How to instantiate static nested classes in java?

1012


Why there are some null interface in JAVA? What does it mean? Give some null interface in JAVA?

1027


How does split work in java?

985


What is the size of an array?

963


What is the difference between overriding and overloading in OOPS.

1073


What are the drawbacks of singleton class?

950


What is bitwise complement?

925


What is ph and buffers?

937