You need to sign in to do that
Don't have an account?
Camilo Andres Torres Patiño
I need help with Unexpected token '='.
Hi, I was programming a class but when I executed the code, it appeared an error saying: Line: 2, Column: 7, Unexpected token '='. Somebody could tell me why this error is pop-upping and how to solve it?
Here is my code:
Here is my code:
Can you try to use the add function present for the list class instead of assigning to the list individually.
you can check the below snippet of code once:
public static List<String> generateStringArray(Integer n)
{
List<String> List1 = new List<String>();
for(Integer i =0; i < n; ++i)
List1.add('Test ' + i);
return List1;
}
This worked for me let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.
FormattedStrings[n] = 'Test ' + String.valueOf(n);
With:
FormattedStrings.add('Test ' + n);