Home SALESFORCEAPEX Iterating Map using for loop in Apex Class

You can user keyset() method to iterate over keys in map to fetch values
Apex Class:

 Map fieldList = new Map{‘Name__c’=>’Name’, ‘Age__C’=>’Age’}; for (String fieldName : fieldList.keySet()){ system.debug(fieldName); } 

You may also like