---
schema_version: "1"
id: 0c2f31ee352bc08470b418fe03c3f33fa106ee73f4eeba01caa8d9ec310a2c86
title: Work with Apex Code
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforcedx/webconsole/guides/work-with-code/work-with-code.md
canonical_url: https://developer.salesforce.com/docs/platform/webconsole/guide/work-with-code.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1b07a07a8827b01f75cdaf52717be08aab53d43e39c916b0a1d1bb728ab4f0e0
products:
  - Web Console
  - salesforcedx
---
# Work with Apex Code

Apex is a typed, object-oriented programming language that enables developers to run the flow and transaction control statements on the Lightning Platform server with calls to the Lightning Platform API. Because Apex uses syntax that looks like Java and acts like database-stored procedures, developers can add business logic to most system events, including button clicks, related record updates, and Visualforce pages. The web-service requests and triggers on objects initiate Apex code.

Apex can be stored on the platform in two different forms.

- A class is a template or blueprint from which Apex objects are created. Classes consist of other classes, user-defined methods, variables, exception types, and static initialization code. From Setup, enter `Apex Classes` in the Quick Find box and then select **Apex Classes**.
- A trigger is Apex code that executes before or after specific Data Manipulation Language (DML) events occur, such as before object records are inserted into the database or after records have been deleted. Triggers are stored as metadata in Salesforce. A list of all triggers in your organization is located on the Apex Triggers page in Setup.

For more information about creating Apex objects, see [Apex Code Overview](https://help.salesforce.com/s/articleView?id=platform.code_about.htm&type=5).
