You need to sign in to do that
Don't have an account?
ashish jadhav 9
how to decide when to use list and when to use set?
please explain when should I go for set and list?
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
List and Set 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>
Find below link for Detailed explanation regarding collections
http://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_collections.htm
Thanks