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

Why 1 is not a prime number?

1022


What are the major drawbacks of external iteration?

1057


How do you access command-line arguments within the code?

1053


What is reverse function?

1123


What is a 16 bit word?

991


Can a abstract class be defined without any abstract methods?

997


what is the difference between Object Based Language and Object Oriented Language?

1030


What is the difference between array and array list in java?

1221


Define interface in java?

1071


What is integers and example?

982


What are constants?

1049


Can we inherit a class with private constructor?

1120


What is the difference between JVM and JRE?

1093


Can we override final method?

1004


How do you remove duplicates from an array in java?

951