The below is a valid way to create a Map.
Map<Id, Opportunity> mapOpps = new Map <Id, Opportunity>();
I know that I can use String in place of ID. BUT could someone please explain to me why can't I use Name, as shown?
Map<Name, Opportunity> mapOpps = new Map <Name, Opportunity>();
mapContacts
. I'd name itopportunitiesById
- the...by...
is the cue it is a map.