The basic difference between a Vector and an ArrayList is that, vector is synchronized while ArrayList is not. Thus whenever there is a possibility of multiple threads accessing the same instance, one should use Vector. While if not multiple threads are going to access the same instance then use ArrayList. Non synchronized data structure will give better performance than the synchronized on
Search
Useful Links
Showing posts with label Java Collection Interview Questions. Show all posts
Showing posts with label Java Collection Interview Questions. Show all posts
Wednesday, May 18, 2011
Tuesday, May 17, 2011
Size and capacity of a Vector
The size is the number of elements actually stored in the vector, while capacity is the maximum number of elements it can store at a given instance of time.
Monday, May 16, 2011
What is an enumeration?
An enumeration is an interface containing methods for accessing the underlying data structure from which the enumeration is obtained. It is a construct which collection classes return when you request a collection of all the objects stored in the collection. It allows sequential access to all the elements stored in the collection.
What is an Iterator interface?
A: The Iterator interface is used to step through the elements of a Collection .
Q : Which java.util classes and interfaces support event handling?
A: The EventObject class and the EventListener interface support event processing.
Q : Which java.util classes and interfaces support event handling?
A: The EventObject class and the EventListener interface support event processing.
What is the Collections API?
The Collections API is a set of classes and interfaces that support operations on collections of objects.
Subscribe to:
Posts (Atom)