Activity Forums Salesforce® Discussions What is the use of size() in map in Salesforce?

  • Deepak

    Member
    February 21, 2020 at 2:52 pm

    Hi Pooja,

    size() Returns the number of key-value pairs in the map.

  • Kirandeep

    Member
    February 21, 2020 at 3:13 pm

    Hi Pooja,

    size() is a pre defined function in map class which returns the number of key-value pairs in the map.

  • Aditya

    Member
    February 21, 2020 at 4:26 pm

    A map is a collection of key-value pairs where each unique key maps to a single value. In map Keys can be any primitive data type like string, integer,decimal, Id while values can be a primitive, sObject, collection type or an Apex object

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos