You need to sign in to do that
Don't have an account?
Can any one help me on this....
the challenge is ,
Create an Apex class that returns an array (or list) of formatted strings ('Test 0', 'Test 1', ...). The length of the array is determined by an integer parameter.The Apex class must be called 'StringArrayTest' and be in the public scope.
The Apex class must have a public static method called 'generateStringArray'.
The 'generateStringArray' method must return an array (or list) of strings. Each string must have a value in the format 'Test n' where n is the index of the current string in the array. The number of returned strings is specified by the integer parameter to the 'generateStringArray' method.
and the code i tried is...
Public class StringArrayTest
{
public static void generateStringArray ( String test)
{
String[] testnum = new String{'test 1','test 2'};
for(Integer i=0;i<testnum.size();i++)
{
System.debug(testnum [i]);
}
return generateStringArray
}
}
please correct me...
Create an Apex class that returns an array (or list) of formatted strings ('Test 0', 'Test 1', ...). The length of the array is determined by an integer parameter.The Apex class must be called 'StringArrayTest' and be in the public scope.
The Apex class must have a public static method called 'generateStringArray'.
The 'generateStringArray' method must return an array (or list) of strings. Each string must have a value in the format 'Test n' where n is the index of the current string in the array. The number of returned strings is specified by the integer parameter to the 'generateStringArray' method.
and the code i tried is...
Public class StringArrayTest
{
public static void generateStringArray ( String test)
{
String[] testnum = new String{'test 1','test 2'};
for(Integer i=0;i<testnum.size();i++)
{
System.debug(testnum [i]);
}
return generateStringArray
}
}
please correct me...
It should go like this.
Thanks,
Himanshu