Activity Forums Salesforce® Discussions 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>>();

  • shariq

    Member
    July 14, 2017 at 1:56 pm

    Thanks Aman, It helps a lot.

  • Parul

    Member
    September 16, 2018 at 5:06 am

    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.

Popular Salesforce Blogs

Popular Salesforce Videos