You need to sign in to do that
Don't have an account?
Deepika Ghose
Getting this error in 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.
My code is:
public class StringArrayTest {
public static List<String> generateStringArray(Integer l)
{
List<String> a1=new List<String>();
for(i=0;i<l;i++)
{
a1.add('Test '+i);
System.debug(a1[i]);
}
return a1;
}
}
m executing through
StringArrayTest em = new StringArrayTest();
em.generateStringArray(5);
Can anyone help me whats wrong I did here?
Executing the 'generateStringArray' method failed. Either the method does not exist, is not static, or does not return the proper number of strings.
My code is:
public class StringArrayTest {
public static List<String> generateStringArray(Integer l)
{
List<String> a1=new List<String>();
for(i=0;i<l;i++)
{
a1.add('Test '+i);
System.debug(a1[i]);
}
return a1;
}
}
m executing through
StringArrayTest em = new StringArrayTest();
em.generateStringArray(5);
Can anyone help me whats wrong I did here?
Can you share challenge description.
Regards,
Ajay Mishra
Email: mishraajay.m1@gmail.com
try below code
Thanks
Mark it best answer if it helps you :)
As mention in Challenge String should be returned in this format 'Test n'.
You are missing the spcae in between them. Please add a space in front of 'Test'.
Your Challenge will be completed.
Regards,
Ajay Mishra
1) https://developer.salesforce.com/forums/?id=906F0000000BTQ9IAO
Problem in your code is that you need to pass one space between 'Test '+i and you need to start loop from zero
Please try below code:- And go :
Your Name>Developer Console>Debug>Open Execute Anonymous Window
Paste below code in it Please let us know if this will help you