List:
List is a ordered collection of values. It contains duplicate values. Each value is retrieved using the List Index.
Ex:
List<String> temp = new List<String>();
temp.add(‘Newyork’);
temp.add(‘Miami’);
temp.add(‘Boston’);
List is a ordered collection of values. It contains duplicate values. Each value is retrieved using the List Index.
Ex:
List<String> temp = new List<String>();
temp.add(‘Newyork’);
temp.add(‘Miami’);
temp.add(‘Boston’);
Set:
Set is an unordered collection of values. It does not contains duplicate values.
Map:
Map is a key value pair datatype.
Ex:
Country (Key)
|
‘
States |
‘
|
‘
|
‘
|
‘
|
Currency (Value)
|
‘Dollar’
|
‘Pound’
|
‘Rupee’
|
‘Yen’
|
‘Euro’
|
Cheers!!!