Activity Forums Salesforce® Discussions How to copy from one map to another map in Salesforce?

  • Aditya

    Member
    June 24, 2020 at 4:24 pm

    Map<Integer, String> m1 = new Map<Integer, String>();
    m1.put(1, 'First item');
    m1.put(2, 'Second item');
    Map<Integer, String> m2 = new Map<Integer, String>(m1);
    // The map elements of m2 are copied from m1
    System.debug(m2);

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos