To write some code, you actually type statements into a file. It can be an Apex class, a trigger, or a Visualforce page. Without any control flow statement, the platform executes the statements in the order they appear, from top to bottom and from left to right.
You can use control flow statements to execute code in certain circumstances (conditions), to repeatedly execute a block of code, or to break up the execution when a certain condition is true. Let's dive into the different control flow statements in Apex. If you are familiar with programming Java, you will recognize some similarities.