Collections in Java
Collections in Java
Collection :-
2. List :-
3. Set :-
o Set is child interface of Collection.
o If we want to represent a group of individual objects as a single entity where
duplicates are not allowed and insertion order are not preserved then we should go
for Set.
4. SortedSet :-
SortedSet is child interface of Set.
o If we want to represent a group of individual objects as a single entity where
duplicates are not allowed but all objects should be inserted according to some
sorting order then we should go for SortedSet
5. NavigableSet :-
It is the child interface of SortedSet.
It defines several methods for navigable purpose.
6. Queue:-
It is child interface of Collection.
If we want to represent a group of individual objects prior to processing
then we should go for Queue.
Ex: before sending a mail all mail id’s we have to store somewhere and in
which order we saved in the same order mail’s should be delivered(First in
First out) for this requirement
Queue concept is the best choice.
o Note:-
8. SortedMap
It is the child interface of map.
If we want to represent a group of key value pairs according to some
sorting order of keys then we should go for SortedMap.
9. NavigableMap(I)
https://javatechtube.blogspot.com/2019/03/spring-web-mvc-flow.html