Difference between List and Set:
List | Set |
---|---|
1. The List is an ordered sequence. | 1. The Set is an unordered sequence. |
2. List allows duplicate elements | 2. Set doesn’t allow duplicate elements. |
3. Elements by their position can be accessed. | 3. Position access to elements is not allowed. |
4. Multiple null elements can be stored. | 4. Null element can store only once. |
5. List implementations are ArrayList, LinkedList, Vector, Stack | 5. Set implementations are HashSet, LinkedHashSet. |
MAP:
A Map is a type of fast key lookup data structure that offers a flexible means of indexing into its individual elements.
Indices into the elements of a Map are called keys.
Indices into the elements of a Map are called keys.
These keys, along with the data values associated with them, are stored within the Map. Each entry of a Map contains exactly one unique key and its corresponding value.
0 Comments:
張貼留言