You need to sign in to do that
Don't have an account?

Getting Started with Apex
Challenge Not yet complete... here's what's wrong:
Executing the 'generateStringArray' method failed. Either the method does not exist, is not static, or does not return the proper number of strings.
the exercise was complete and ran and followed the instructions why were the points not awarded?
Executing the 'generateStringArray' method failed. Either the method does not exist, is not static, or does not return the proper number of strings.
the exercise was complete and ran and followed the instructions why were the points not awarded?
your testArray.add('Test'+ i+'\'' ); is off.
it should be testArray.add('Test '+ i );
See below for example:
As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks
All Answers
Thx
public static String[] generateStringArray (Integer n) {
String[] testArray = new String[] {};
for(Integer i=0;i<n;i++) {
testArray.add('Test'+ i+'\'' );
}
System.debug(testArray);
return testArray;
}
}>
your testArray.add('Test'+ i+'\'' ); is off.
it should be testArray.add('Test '+ i );
See below for example:
As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks