Hello Everyone, In this tutorial, I am going to describe the Apex programming language, which is used in Force.com platform.

After Completing this unit, you’ll be able to:
  • Describe Apex programming language.
  • Describe the key features of the Apex.
  • Data types in Apex.
So let’s begin

Apex Programming language

Apex is a programming language developed by Salesforce.com. It's used Java-like syntax and acts like a database stored procedure. Being an object-oriented programming language it allows developers to execute flow and transaction control statements on Salesforce servers in conjunction with calls to the API. It provides a development platform for SaaS (software as a service) applications. Apex enables developers to add business logic for button clicks, updates of related records, and Visualforce pages.
            Apex includes an API that developers can use to access user data on Salesforce.com. It hosted and run directly from Salesforce.com’s servers. So no installation necessary on a user’s local PC is because of this hosting.

Feature of Apex
  1. Saved, compiled and executed on the server-the Lightning Platform.
  2. It’s an objected oriented programming language that supports classes, interface, and inheritance.
  3. Apex is easy to use because it based on familiar Java idioms.
  4. Apex easy to test, provide built-in support for unit test creation, execution, and code coverage.
  5. Apex is strongly typed.
  6. Apex provides statement and query languages to manipulate database records.
  7. Apex versioned so the code can be saved different versions of the API.
  8. It provides transactional access to the database that allows you to roll back operations.

Apex Language highlights

There are some of the language constructs that Apex supports:
  1. Object and array notation.
  2. Conditional statements like if-then-else and control flow statements such as for and while loops).
  3. Classes, interfaces, properties, and collections (including arrays).
  4. Expressions, variables, and constants.
Like other object-oriented programming languages, Apex supports:
  1. Versioning support for the code.
  2. Apex is stored, compiled, and executed in the cloud that supports cloud development.
  3. Support query language to query data and database statement that make direct database calls.
  4. The access modifiers such as global and public.
  5. Transactions and Rollbacks.
Apex Datatypes

Apex supports the following data types.
  1. Primitive data type like Integer, Double, Long, Date, DateTime, String, ID,  or Boolean.
  2. Collection data types like Lists, Sets, and Maps
  3. sObjects and List of sObjects
  4. Classes, Objects, and Interfaces.
  5. Typed list of values, known as an enum.

Development Tools

For writing apex following types of development tools:

Developer Console: In Salesforce user interface, open the Developer console under your name. It directly runs in the browser.

Force.com IDE plugin for Eclipse: Apex is also written on a client-side by using Force.com IDE plugin for Eclipse.

See also:

Conclusion:
Hope you like this tutorial, for any query or suggestions please feel free to comment.
Thank you.