
Yes we can use list of map in Salesforce for example List<Map<Id,Account> listofMap = new List<Map<Id,Account>> ();
Full Answer
What is the difference between list and map in Salesforce?
If you use a List, you'll get a List collection that consists of queried SObjects which you used in the "FROM" clause. If you use a Map, you'll get a Map collection that consists of queried SObjects IDs as the key set and SObjects as the value set. In other words, the map elements will be "ID => SObject"
What is a map key in Salesforce?
Map keys and values can be of any data type—primitive types, collections, sObjects, user-defined types, and built-in Apex types. Uniqueness of map keys of user-defined types is determined by the equals and hashCode methods, which you provide in your classes.
What is the difference between a list and a map collection?
If you use a List, you'll get a List collection that consists of queried SObjects which you used in the "FROM" clause. If you use a Map, you'll get a Map collection that consists of queried SObjects IDs as the key set and SObjects as the value set.

What are the differences between a map and a list in Salesforce?
A list is an ordered collection of elements that are distinguished by their indices. List elements can be of any data type—primitive types, collections, sObjects, user-defined types, and built-in Apex types. A map is a collection of key-value pairs where each unique key maps to a single value.
How do I convert a list to a map in Salesforce?
Converting List to Map://Converting list to map.Map
What is set list map in Salesforce?
MapsCollection TypeDescriptionListAn ordered group of items of the same type. Each item has an index number that represents its position in the list.SetAn unordered group of unique items of the same type.MapA collection of key-value pairs. Each unique key maps to a single value.
How many records a list can hold in Salesforce?
A list can hold 1000 elements(as per the limit).
Can we convert List to set in Salesforce?
The simplest way to convert List to Set in Salesforce is given below: List
How do I add a List to a set in Salesforce?
You can assign the value of list to set by using predefine methods of Set. List
What is the difference between a map and a list?
Lists:: A list is an ordered collection of elements that are distinguished by their indices. List elements can be of any data type—primitive types, collections, sObjects, user-defined types, and built-in Apex types. A map is a collection of key-value pairs where each unique key maps to a single value.
How many records can a map hold in Apex?
The 50k is in the Batch Apex docs. The 500k is based on approximate memory usage for ID values in a set. The code I shared has a limit of 50m records, also mentioned in the docs.
What is difference between list and Set?
List is an ordered sequence of elements whereas Set is a distinct list of elements which is unordered.
How many records can be stored in list?
You can store up to 30 million items or files in a list or library. Filtered views of large lists have a similar experience to other lists. However, when a list view shows more than 5000 items, you may run into a list view threshold error.
How much can a list hold?
MaxValue or 2,147,483,647 is the most items you could stick in a list. Really got to question why on earth you would need that many, there is likely to be a more sensible approach to managing the data.
How many elements can you store in a list?
1) Yes, list can store 100000+ elements.
How to tell if two maps are equal?
Two maps are equal if their key/value pairs are identical, regardless of the order of those pairs. The == operator is used to compare the map keys and values. The == operator is equivalent to calling the equals method, so you can call map1.equals (map2); instead of map1 == map2;.
Is a map key case sensitive?
Map keys of type String are case-sensitive. Two keys that differ only by the case are considered unique and have corresponding distinct Map entries. Subsequently, the Map methods, including put, get, containsKey, and remove treat these keys as distinct. For more information on maps, see Maps. Map Constructors.
