The following statement gives error. What is the problem?

Map<string, customB__c=""> myBMap = new Map<id, customB__c="">();

Error is

Error: Compile Error: unexpected token: 'Map' at line 11 column 0

Please advice.

1 Answer 1


You need to declare it like this

Map<Id,YourObject> myMap = new Map<Id,YourObject>();

Map class

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .