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 diff b/w arraylist and vector?

Answer Posted / umanath

Vector and ArrayList are very similar. Both of them
represent a 'growable array',
ArrayList it's part of the Java Collection Framework, and
has been added with version 1.2, Vector it's an object that
is present since the first version of the JDK.
The main difference is that Vector it's a synchronized
object, while ArrayList it's not.
While the iterator that are returned by both classes are
fail-fast (they cleanly thrown a
ConcurrentModificationException when the original object has
been modified), the Enumeration returned by Vector are not.

Unless you have strong reason to use a Vector, the
suggestion is to use the ArrayList.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the transient field modifier?

1048


describe method overloading

1016


what do you mean by classloader?

1090


What one should take care of, while serializing the object?

903


How transient variable is different from volatile variable?

1080


How many bytes is double?

970


Explain java coding standards for constants?

1014


What is the difference between double and float variables in java?

1150


What is a generic data type?

1040


What steps are taken when the OS shifts from one-thread execution to another?

1366


How to sort an array from smallest to largest java?

986


Can you explain the cs option of java interpreter?

949


What is size () in java?

1093


What are use cases?

976


Write a program to show whether a graph is a tree or not using adjacency matrix.

1096