You need to sign in to do that
Don't have an account?
Deepu B
For the above task i have created a class as below,
public class StringArrayTest
{
public string[] arraynames;
public StringArrayTest()
{
arraynames=new string[]{};
}
public string[] generateStringArray(integer num)
{
for(integer i=0;i<num;i++)
{
string s='Test'+i;
/*arraynames.add(s);*/
system.debug(s);
}
return arraynames;
}
}
it showing below error
where i did mistake.?
Method error
For the above task i have created a class as below,
public class StringArrayTest
{
public string[] arraynames;
public StringArrayTest()
{
arraynames=new string[]{};
}
public string[] generateStringArray(integer num)
{
for(integer i=0;i<num;i++)
{
string s='Test'+i;
/*arraynames.add(s);*/
system.debug(s);
}
return arraynames;
}
}
it showing below error
where i did mistake.?
Try this, this will work:
As your method should be static as it is given.
Please mark this as Best Answer if it helps to solve your problem.
Let me know if you have any issue in that
All Answers
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others and improve the overall quality of Discussion Forums.
Gaurav Kheterpal
Certified Force.com Developer| Salesforce Mobile Evangelist| Developer Forums Moderator| Dreamforce Speaker
Try this, this will work:
As your method should be static as it is given.
Please mark this as Best Answer if it helps to solve your problem.
Let me know if you have any issue in that
You can go ahead with trailhead.......its good for practise purpose........and read apex developer guide.