You need to sign in to do that
Don't have an account?
BigMag
Verify Challenge error???
The initial Apex challenge:
public class StringArrayTest {
private static List<String> ReturnedStrings = new List<String>();
public static void generateStringArray (Integer StringsCount){
for (Integer i = 0; i < StringsCount;i++){
ReturnedStrings.add('Test ' + String.valueOf(i) );
System.debug(ReturnedStrings);
}
}
}
ran nicely in the devlopper console.
But I got this error when I clicked Check Challenge
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.
public class StringArrayTest {
private static List<String> ReturnedStrings = new List<String>();
public static void generateStringArray (Integer StringsCount){
for (Integer i = 0; i < StringsCount;i++){
ReturnedStrings.add('Test ' + String.valueOf(i) );
System.debug(ReturnedStrings);
}
}
}
ran nicely in the devlopper console.
But I got this error when I clicked Check Challenge
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.
You've correctly constructed the strings for each iterations, but your method is declared as void, meaning nothing will be returned. You will need to refactor your method to meet the requirements above, and then it will pass the assessment. Good luck!
https://developer.salesforce.com/forums/?id=906F0000000BKOTIA4
Please let us know if this will help you.
Thanks
Amit Chaudhary
All Answers
You've correctly constructed the strings for each iterations, but your method is declared as void, meaning nothing will be returned. You will need to refactor your method to meet the requirements above, and then it will pass the assessment. Good luck!
https://developer.salesforce.com/forums/?id=906F0000000BKOTIA4
Please let us know if this will help you.
Thanks
Amit Chaudhary