Core Java

Collections Subjective Questions And Answers


Totel:22 Click: 1 2 3 4 5
Collections Interview Questions And Answers

Page 1

Map is Interface and Hashmap is class that implements this interface.


Iterator : Enables you to cycle through a collection in the forward direction only, for obtaining or removing elements

ListIterator : It extends Iterator, allow bidirectional traversal of list and the modification of elements


1. The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls. (HashMap allows null values as key and value whereas Hashtable doesnt allow nulls). 

2. HashMap does not guarantee that the order of the map will remain constant over time. 

3. HashMap is non synchronized whereas Hashtable is synchronized. 

4. Iterator in the HashMap is fail-safe while the enumerator for the Hashtable isn't.


Vector is synchronized whereas ArrayList is not. The Vector class provides the capability to implement a growable array of objects. ArrayList and Vector class both implement the List interface. Both classes are implemented using dynamically resizable arrays, providing fast random access and fast traversal. In vector the data is retrieved using the elementAt() method while in ArrayList, it is done using the get() method. ArrayList has no default size while vector has a default size of 10. when you want programs to run in multithreading environment then use concept of vector because it is synchronized. But ArrayList is not synchronized so, avoid use of it in a multithreading environment.


The Iterator is an interface, used to traverse through the elements of a Collection. It is not advisable to modify the collection itself while traversing an Iterator.



Goto Page:

1 2 3 4 5
Collections Objective Questions And Answers

Collections Objective Questions And Answers

Collections Interview Questions And Answers

Collections Interview Questions And Answers


R4R,Collections Objective fresher and experienced, Collections Subjective fresher and experienced ,Collections Interview Questions And Answers,Collections fresher and experienced,Collections Interview fresher and experienced ,Collections Questions fresher and experienced,Collections Answers fresher and experienced