Set in Salesforce

Set It doesn’t allow duplicates. It maintains dictionary order. Set maintains hash code mechanism. It allows only one null value. Syntax set<Datatype> variable name = new set<Datatype>(); Methods Add(Element); addAll(list/set s); contains(Element); containsAll(set/list s); size(); clear(); remove(Element);

List in Salesforce

List It allows Duplicate values . It maintains insertion order. List maintains index based. It allows multiple null values. Syntax List<Datatype> variable name = new List<Datatype>(); Examples List<integer> a = new List<integer>(); List<Account> b = new List<Account>(); List<integer> ages;  Ages = new List<integer>(); List<integer> ages = new List<integer>(){20,30,50}; Methods available in List add(Element); add(index,Element); addAll(list… Read More »

Custom settings in Salesforce

What is custom setting? Custom setting is also used to store the data, but the data which is stored here can be retrieved without writing a soql query. As if we retrived data without writing soql query then performance will be faster They are 2 types of custom settings, they are :- List custom setting… Read More »