Play Games

Search This Blog

Sunday, September 6, 2020

How to get size of a map in Apex Salesforce - Salesforce Globe For You

 How to get size of a map in Apex Salesforce  - Salesforce Globe For You 

Solution:Use size() to get size of map.

Example:

Map<String,String> alphabetMap = new Map<string,String>();

alphabetMap.put('A','Apple');

alphabetMap.put('B','Ball');

alphabetMap.put('C','Cat');

system.debug('Map size:'+alphabetMap.size());

Output:


No comments:

Post a Comment