3

I receive this error:

Line: 5, Column: 4 unexpected token: '<'

When executing this code in the execute anonymous window in the developer console:

Map<String, List<Custom_Object__c>> idsToCustomObjectList = Map<String, List<Custom_Object__c>>();

Why do I get this error? How can I fix it?

0

1 Answer 1

17

The error is a little misleading. You are missing the new keyword when you assign idsToCustomObjectList.

Map<String, List<Custom_Object__c>> idsToCustomObjectList = new Map<String, List<Custom_Object__c>>();

You must log in to answer this question.

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