You need to sign in to do that
Don't have an account?
Divya Gupta 11
Create an Apex class that returns an array (or list) of strings.-Error
public class StringArrayTest {
public static List<String> generateStringArray(Integer n){
String[] test = new List<String>();
for(Integer i=0;i<n;i++){
test.add('Test'+i);
System.debug(test[i]);
}
Getting an error "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."
return test;
}
}
public static List<String> generateStringArray(Integer n){
String[] test = new List<String>();
for(Integer i=0;i<n;i++){
test.add('Test'+i);
System.debug(test[i]);
}
Getting an error "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."
return test;
}
}
test.add('Test '+i);