Newer Version Available
Control Flow Statements
Apex provides if-else statements and loops to control the flow of code execution.
Statements are generally executed line by line, in the order they appear. With control flow
statements, you can make Apex code execute based on a certain condition, or have a block of
code execute repeatedly.