---
schema_version: "1"
id: 96e26bb25d1eb2f039125f94a67e3c27bcb1ca7c9cac42dd50394c5c403debf8
title: Apex Quick Start
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexcode/apex_qs_HelloWorld.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_qs_HelloWorld.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 24c5a5250df917dc6366c68cac34d425de8e2a513e10e8edab6d120e0ebb3c5f
description: This step-by-step tutorial shows how to create a simple Apex class and trigger, and how to deploy these components to a production organization.
---
# Apex Quick Start

This step-by-step tutorial shows how to create a simple Apex class and trigger, and how to deploy these components to a production organization.

When you have a Developer Edition or sandbox organization, you can learn some of the core concepts of Apex. After reviewing the basics, you’re ready to write your first Apex program—a simple class, trigger, and unit test.

Because Apex is similar to Java, you can recognize much of the functionality.

This tutorial is based on a custom object called Book that is created in the first step. This custom object is updated through a trigger.

This Hello World sample requires custom objects. You can either create these objects on your own, or download the objects and Apex code as an unmanaged package from AppExchange. To obtain the sample assets in your org, install the [Apex Tutorials Package](https://appexchange.salesforce.com/listingDetail?listingId=a0N30000001saDCEAY "html (New Window)"). This package also contains sample code and objects for the Shipping Invoice example.

![Note](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/images/icon_note.png)

#### Note

There’s a more complex [Shipping Invoice example](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_shopping_cart_example.htm) that you can also walk through. That example illustrates many more features of the language.

1. [Create a Custom Object](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_qs_customobject.htm)  
    In this step, you create a custom object called Book with one custom field called Price.
2. [Add an Apex Class](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_qs_class.htm)  
    In this step, you add an Apex class that contains a method for updating the book price. This method is called by the trigger that you’ll be adding in the next step.
3. [Add an Apex Trigger](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_qs_trigger.htm)  
    In this step, you create a trigger for the Book\_\_c custom object that calls the applyDiscount method of the MyHelloWorld class that you created in the previous step.
4. [Add a Test Class](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_qs_test.htm)  
    In this step, you add a test class with one test method. You also run the test and verify code coverage. The test method exercises and validates the code in the trigger and class. Also, it enables you to reach 100% code coverage for the trigger and class.
5. [Deploy Components to Production](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_qs_deploy.htm)  
    In this step, you deploy the Apex code and the custom object you created previously to your production organization using change sets.