MCQs
search()
keySet() methods is used to get a set containing all the keys used in a map. This method provides set view of the keys in the invoking map.
Maps revolve around two basic operations “ get() and put(). to put a value into a map, use put(), specifying the key and the value. To obtain a value, call get() , passing the key as an argument. The value is returned
Array
HashSet and TreeSet implements Set interface where as LinkedList and ArrayList implements List interface.
Vectors are dynamic arrays, it contains many legacy methods that are not part of collection framework, and hence these methods are not present in ArrayList. But both are used to form dynamic arrays.
elementCount
addElement() is used to add data in the vector, to obtain the data we use elementAt() and to first and last element we use firstElement() and lastElement() respectively.
Stack, Hashtable, Vector, Properties and Dictionary are legacy classes.
Enumeration