Apex Loops

,

Apex supports the three standard types of loops for implementing repeated actions: Do-while, While, and For loops.

Do-while Loops

A Do-while loop repeatedly executes a set of code statements. The syntax for the loop is as follows:

do {
 code_block;
       }
       while (Boolean_condition);

The code within the curly braces executes and then the condition is evaluated. A Do-while loop always executes at least once.

While Loops

A While loop is like a do-while loop, except that the while condition is evaluated before any of the statements in the code are executed. Because of this, the code in a While loop might not be executed at all. The syntax for the While loop is as follows:

while (Boolean_condition) {
 code_block;
       };

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.100.40