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 / janardhan

ArrayList contains all methods are non-synchronized methods.
ArrayList by default not threadsafe.
ArrayList allows duplicate objects.
ArrayList default size is 16.if you want to increase size
use this formula:-- defaultsize * 3/2 + 1.
we can make araylist as synchronised:--

List l=Collections.SynchronizedList(new arrayList());

Arraylist is best choice for retrival operation and worest
choice for insert operation.


Vector:--

Vector is same like arraylist, but we have only one
difference is vector contains all synchronized methods.

Vector is best choice for retrival operation and worest
choice for insert operation.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of static methods and variables?

997


What is command line argument

1164


What do you know about the garbate collector?

984


Explain the significance of listiterator.

1032


What is java in detail?

1029


What are reference variables in java?

1080


Explain java code for recursive solution's base case?

980


What are the types of literals?

1100


What is executor memory?

902


Is string a wrapper class?

975


Explain implementation and how is it different from conversion?

1021


Why unicode is important?

900


Why inputstreamreader is used in java?

962


What do you mean by byte code?

959


Can a class be a super class and a sub-class at the same time? Give example.

1471