Theoretical Paper
- Computer Organization
- Data Structure
- Digital Electronics
- Object Oriented Programming
- Discrete Mathematics
- Graph Theory
- Operating Systems
- Software Engineering
- Computer Graphics
- Database Management System
- Operation Research
- Computer Networking
- Image Processing
- Internet Technologies
- Micro Processor
- E-Commerce & ERP
Practical Paper
Industrial Training
Apex - Loops
Loops are used when a particular piece of code should be repeated with the desired number of iteration. Apex supports the standard traditional for loop as well as other advanced types of Loops. In this chapter, we will discuss in detail about the Loops in Apex. A loop statement allows us to execute a statement or group of statements multiple times and following is the general from of a loop statement in most of the programming languages −
The following tables lists down the different Loops that handle looping requirements in Apex Programming language. Click the following links to check their detail.
Sr.No. | Loop Type & Description |
---|---|
1 | for loop This loop performs a set of statements for each item in a set of records. |
2 | SOQL for loop Execute a sequence of statements directly over the returned set o SOQL query |
3 | Java-like for loop Execute a sequence of statements in traditional Java-like syntax. |
4 | while loop Repeats a statement or group of statements while a given condition is true. It tests the condition before executing the loop body. |
5 | do...while loop Like a while statement, except that it tests the condition at the end of the loop body. |