- Apex - Deployment
- Apex - Testing
- Apex - Debugging
- Apex - Batch Processing
- Apex - Governer Limits
- Apex - Trigger Design Patterns
- Apex - Triggers
- Apex - Invoking
- Apex - Security
- Apex - SOQL
- Apex - SOSL
- Apex - Database Methods
- Apex - DML
- Apex - Interfaces
- Apex - Objects
- Apex - Methods
- Apex - Classes
- Apex - Collections
- Apex - Loops
- Apex - Decision Making
- Apex - Constants
- Apex - Arrays
- Apex - Strings
- Apex - Variables
- Apex - Data Types
- Apex - Example
- Apex - Environment
- Apex - Overview
- Apex - Home
Apex Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
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 psts down the different Loops that handle looping requirements in Apex Programming language. Cpck the following pnks to check their detail.
Sr.No. | Loop Type & Description |
---|---|
1 | This loop performs a set of statements for each item in a set of records. |
2 | Execute a sequence of statements directly over the returned set o SOQL query. |
3 | Execute a sequence of statements in traditional Java-pke syntax. |
4 | Repeats a statement or group of statements while a given condition is true. It tests the condition before executing the loop body. |
5 | Like a while statement, except that it tests the condition at the end of the loop body. |