Thursday, 4 February 2016

Difference between list, set and map

List: List allows duplicate elements
Set : Set doen't allow duplicates.
Map : Map stored the key and value pair, map doesn't allow duplicate keys while it allows duplicate values
List : List allows any number of null values
Set : Set allows single null value at most
Map : Map can have single null key at most and any number of null values
List : List maintains the insertion order
Set : set doesn't maintain any order.
Map : Map doesn't maintain any order.

No comments:

Post a Comment