What are the various ways to iterate over a list ?
To iterate over a list in two different ways :
1. Using iterator.
2. Using for-each loop.

Is Listiterator inherits from Iterator interface ?
Yes, ListIterator inherits from Iterator interface.

What are the main classes that implements Map interface ?
The main classes that implements Map interface are : Hashtable, HashMap, EnumMap, LinkedHashMap, IdentityHashMap,  and Properties.

What are the main classes that implements Set interface ?
The main classes that implements Set interface are : EnumSet, HashSet, LinkedHashSet and TreeSet.

What are the main classes that implements List interface ?
The main classes that implements List interface are : Vector, Stack, ArrayList and LinkedList.

Name the different Collection views provided by Map interface ?
The Collection views provided by Map interface are :
1. key set view.
2. value set view.
3. entry set view.

How all the views can be navigated ?
By using iterators all the views can be navigated.

How many null keys allowed in HashSet ?
Only one.

List the collection classes that provide random access of it’s elements?
HashMap, TreeMap, Hashtable and ArrayList classes provide random access to it’s elements.

Name the class that does not override the equals() and hashCode() methods, inheriting directly from class Object?
j
ava.lang.StringBuffer class.

How to make a collection read only?

By using following methods :
Collections.unmodifiableList(list);
Collections.unmodifiableSet(set);
Collections.unmodifiableMap(map);

Difference between Set and List?
T
he differences are :
1. Set is unordered collection where List is ordered collection.
2. List allow duplicate elements but Set does not allow duplicates.
3. List does not prevent inserting null elements, but Set allow only one null element.

How many methods that ListIterator inherits from Iterator?
There are three methods that ListIterator inherits from Iterator are :  next, hasNext and remove.

How to make a collection thread safe?
By Using below methods:
Collections.synchronizedList(list);
Collections.synchronizedSet(set);
Collections.synchronizedMap(map);

Which interface is used to traverse a list in forward and backward direction?

ListIterator interface.

Which method is used to return a Set that contains the entries in a Map?
entrySet() is used to return a Set that contains the entries in a Map.

Write the difference between Vector and ArrayList?
Difference between Vector and ArrayList are-
1. Vector is synchronized but Array List is not synchronized.
2. Vector is a Legacy class where ArrayList is not a Legacy class.
3. Vector increases its size by doubling the array size but ArrayList increases its size by half of the array size.

Which method deletes all the elements from invoking collection?
clear() method.

Which package contain all the collection classes?
java.util.