Advertisement
Learnify_Rectify

Get Started with Apex

Jun 20th, 2024
4,091
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | Source Code | 0 0
  1. Get Started with Apex from (module-Apex Basics & Database)
  2.  
  3. --------------------------------------------
  4. The Apex class must be called StringListTest and be in the public scope :
  5.  
  6. SOURCE CODE:
  7. public class StringListTest {
  8. public static List<String> generateStringList(Integer n) {
  9. List<String> TestList = new List<String>();
  10. for(Integer i=0;i<n;i++) {
  11. TestList.add('Test ' + i);
  12. System.debug(TestList[i]);
  13. }
  14. return TestList;
  15. }
  16. }
  17.  
  18.  
  19. --------------------------------------------
  20. The Apex class must have a public static method called generateStringList :
  21.  
  22. SOURCE CODE:
  23. StringListTest.generateStringList(5);
  24.  
  25.  
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement