Apex Basics

Apex is an object-oriented programming (OOP) language, similar to Java or other OOP languages, that is executed by the Lightning Platform. Like any other OOP language, Apex uses classes, methods, variables, constants, annotations, and so on. However, unusually, Apex is not case-sensitive, while other languages (such as Java) are. 

If you don't know what the definition of OOP is, I can recommend the book, Head First Java, 2nd Edition (you can buy it from http://bit.ly/HeadFJava). If you are familiar with programming in Java, you will see some similarities and some differences. In this book, I will explain how we use OOP within Salesforce by using Apex.

In this chapter, we will cover the following topics:

  • What Apex is and how to develop it
  • Understanding data types in Apex
  • Understanding access to classes in Apex
  • Controlling your logic with control flow statements (if statements and loops)
  • Querying and updating our Salesforce data with various databases
  • Define the key features of the Apex language
  • Know when to use Apex (and when not to)
  • Create a class with methods and call those methods through Anonymous Apex
  • Use the Developer Console to analyze the execution results

In Chapter 5, Apex - Beyond the Basics, you'll get a deeper dive into the Apex language. We
will learn how to build interfaces, virtual classes and bulk processing records.

A little introduction about class in OOP. If you are already familiar with classes (from
Java or other development languages), you can skip these paragraphs.