• animesh singh
  • NEWBIE
  • 15 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 1
    Questions
  • 3
    Replies
public class StringArrayTest{
    public static List<String> generateStringArray(Integer n){
    List<String> lstString = new List<String>();
     for(Integer i=0; i<n;i++){
         lstString.add('\'Test '+i + '\'');        
     }
        System.debug('__________'+lstString);
        return lstString;
    }   
}
public class StringArrayTest{
    public static List<String> generateStringArray(Integer n){
    List<String> lstString = new List<String>();
     for(Integer i=0; i<n;i++){
         lstString.add('\'Test '+i + '\'');        
     }
        System.debug('__________'+lstString);
        return lstString;
    }   
}
Good afternoon,
I can't seem to figure out why my class for the "Getting Started with Apex: Unit 1" won't pass evaluation.  The class appears to work as expected when I run via the Execute Anonymous window, but the checker fails.

Here is my class:

public class StringArrayTest{
    public static void generateStringArray(integer q){
        list<string> test = new list<string>();
            for(integer i=0; i < q;i++){
            test.add('Test '+i);
            system.debug(test[i]);
        }
    }
}

When I run StringArrayTest.generateStringArray(9); in the EAW, I get the return I expected.
Thoughts?