解答例として
Please find below a little fix for your issue.
The problem was the space between Test and the number you had : Test0, Test1.... and what was necessary was Test 0, Test 1,
public class StringArrayTest {
public static List<String> generateStringArray(Integer n)
{
List<String> myArray = new List<String>();
for(Integer i=0;i<n;i++)
{
myArray.add('Test '+i);
System.debug(myArray[i]);
}
return myArray;
}
https://developer.salesforce.com/forums/?id=906F0000000AvPBIA0
Please add ';' at the end of the code.
StringArrayTest.generateStringArray(3);
List<String> stList = StringArrayTest.generateStringArray(3);