Activity Forums Salesforce® Discussions What is the working of Map in Salesforce? Reply To: What is the working of Map in Salesforce?

  • Aman

    Member
    July 13, 2017 at 2:29 pm

    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>>();