Before you can begin to learn about the syntax and capabilities of Apex, you need to learn the basics—the whats, hows, and whys of Apex.
Apex is a strongly-typed, object-based programming language that allows developers to execute logic, flow and transaction control statements on the Force Platform. As you would expect, Apex is intimately connected with Force Platform data, offering powerful data interactions through both a query language and a search language.
You will learn most of the basic syntax in this chapter, with the next chapter devoted specifically to Apex data access and manipulation.
Apex logic can be used in two different ways:
In a database trigger - A trigger is executed ...