Getting Started

  • What is Trailhead
  • myTrailhead
  • Trailblazer Community
  • Career Growth

Learn

  • Trails
  • Trailmixes
  • Modules
  • Projects

Credentials

  • Superbadges
  • Certifications
  • Maintain Certifications

Salesforce

  • Salesforce.com
  • AppExchange
  • Developers
  • Help Portal
© 2026 Salesforce, Inc. All rights reserved. Privacy Terms of Use Trust Accessibility Cookie Preferences
SalesforceTrailhead
  • Today
Apex Basics & Database

Get Started with Apex

+500 Points~30 minsHands-On Challenge
Apex Basics & DatabaseGet Started with Apex

Org:Mindful Goat Playground

Topics

  • Concepts
  • Hands-On Challenge

Looking for help?

Explore Help ResourcesShare Your Feedback
Learning Objectives

After completing this unit, you'll be able to:

  • Describe the key features of Apex.
  • Create an Apex class and call its methods.

Concepts

Apex is a strongly typed, object-oriented language that runs on Salesforce servers. It looks like Java, saves to the platform, and has built-in support for database operations, so you can query and change records with a single line.

Hands-On Challenge

  1. Create a class named StringArrayTest.
  2. Add a public static method generateStringArray that takes an Integer and returns a List of Strings formatted Test 0, Test 1, and so on.
  3. Save the class.
public class StringArrayTest {
  public static List<String> generateStringArray(Integer n) {
    List<String> result = new List<String>();
    for (Integer i = 0; i < n; i++) result.add('Test ' + i);
    return result;
  }
}
Check ChallengeDemo check
Next unit Use sObjects