Activity › Forums › Salesforce® Discussions › What is the working of Map in Salesforce?
Tagged: Help & Training, Map, Salesforce Data, Salesforce Development
-
What is the working of Map in Salesforce?
Posted by shariq on July 13, 2017 at 2:23 PMI want to know the basics of Map(Collection of data).
Parul replied 7 years, 8 months ago 3 Members · 3 Replies -
3 Replies
-
Hello Shariq,
A map is a collection of key-value pairs where each unique key maps to a single value. Keys and values can be any data type—primitive types, collections, sObjects, user-defined types, and built-in Apex types.
To declare a map, use the Map keyword followed by the data types of the key and the value within <> characters. For example:
Map<String, String> country_currencies = new Map<String, String>();
Map<ID, Set<String>> m = new Map<ID, Set<String>>();
- [adinserter block='9']
-
A map is a collection of key-value pairs where each unique key maps to a single value. Keys and values can be any data type—primitive types, collections, sObjects, user-defined types, and built-in Apex types.
Thanks
Log In to reply.