You need to sign in to do that
Don't have an account?

Trailhead First Apex Challenge problem: No Apex class named 'StringArrayTest' was found
I keep getting this error from the challenge. I logged into my developer console from the Trailhead challenge screen using same email address (only have one on Salesforce.com) and nothing has changed since I started the developer track on Trailhead, which requires numerous challenges.
The Apex class named StringArrayTest shows up on the development console and from the setup interface in the developer section....
I am puzzled how it can show up on both and after entering from the trailhead challenge logon to developer edition and still have this error that is is not found. Any suggestion????
The Apex class named StringArrayTest shows up on the development console and from the setup interface in the developer section....
I am puzzled how it can show up on both and after entering from the trailhead challenge logon to developer edition and still have this error that is is not found. Any suggestion????
The below is my StringArrayTest class which worked. Please check if they are the same.
Thanks,
Shyama
Thanks for the input. I just re-wrote the code as there are many versions on the forum. However, I got the same error.
Error while checking challenge using below (and other versions) of the code.... ---------
"Challenge not yet complete... here's what's wrong:
No Apex class named 'StringArrayTest' was found"
Code from Apex Class-------
public class StringArrayTest {
public static String[] generateStringArray (Integer n){
String[] arrayList=new String[]{};
for (integer i=0;i<n;i++){
arrayList.add('Test' +i.format());
}
displayString(arrayList);
return arrayList;
}
private static void displayString(String[] arrayList){
for(integer i=0;i<arrayList.size();i++){
System.debug('hello');
System.debug(arrayList[i]);
}
}
}
The problem was the space between Test and the number you had : Test0, Test1.... and what was necessary was Test 0, Test 1, ...
Please let us know if this will help you
Thanks
Amit Chaudhary
However, that did not resolve the problem. Again, the result after testing the results was that it could not find the Apex class. I did not get a problem type error in the programming and worked thos nuances out... I am not sure why it is not able to see the Apex class StringArrayTest since it is saved in my Apex Developer consule and I can see it from my setup menu developer Apex Classes....
Any help is appreciated.
Yes it shows up in the Setup>Apex classes
amit.salesforce21@gmail.com
Sandeep
public class StringArrayTest {
public static List <String> generateStringArray(Integer n) {
List<String> numbers = new List<String>();
for (integer i=0;i<=n; i++){
numbers.add('Test '+String.valueOf(i));
System.debug(numbers[i]);
}
return numbers;
}
}
for(Integer i=0;i<n;i++)
NOTE :- It shoud be < n not <=n
Public Static List<String> genarateStringArray(integer n)
{
List<String> MyArray =new List<String>();
for(integer i=0;i<n;i++)
{
MyArray.add('Test '+i);
System.debug(MyArray[i]);
}
return MyArray;
}
}
I had developed the class in my developer org but was trailhead was set to trailhead playground.