Hey guys,
This post is for whom who are not aware about LIST, SET, MAP in apex class with its logic.
so, if you need to know then go with below contents......
This post is for whom who are not aware about LIST, SET, MAP in apex class with its logic.
so, if you need to know then go with below contents......
List,Set,Map are called collections in Apex:
LIST : A list is an ordered collection
so use list when you want to identify list element based on Index Number.(Lsit can contain Duplicates)
EX: List<account>
SET : A set is an unordered collection of primitives or sObjects that do not contain any duplicate elements.
So, use set if you want to make sure that your collection should not contain Duplicates.
EX: Set<account>
MAP : A map is a collection of key-value pairs where each unique key maps to a single value. Keys can be any primitive data type, while values can be a primitive, sObject, collection type or an Apex object. For example, the following table represents a map of countries and currencies
In Map, Generally we called as Key-Value pair.
As in your Example: Map<email,Lead>
Then we called as : The value of Email1 is Lead1 and Lead1 has Key as Email1
Thank you.
No comments:
Post a Comment