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 −
Loop Architecture
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
1for loop
This loop performs a set of statements for each item in a set of records.
2SOQL for loop
Execute a sequence of statements directly over the returned set o SOQL query.
3Java-like for loop
Execute a sequence of statements in traditional Java-like syntax.
4while loop
Repeats a statement or group of statements while a given condition is true. It tests the condition before executing the loop body.
5do...while loop
Like a while statement, except that it tests the condition at the end of the loop body.

Contact

Talk to us

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolores iusto fugit esse soluta quae debitis quibusdam harum voluptatem, maxime, aliquam sequi. Tempora ipsum magni unde velit corporis fuga, necessitatibus blanditiis.

Address:

৪৭/ দক্ষিণ বেগুনবাড়ি তেজগাঁও শিল্প এলাকা ঢাকা ১২০৮

Work Time:

সোমবার - শুক্রবার থেকে সকাল 9 টা থেকে বিকাল 5 টা

Phone:

+88 019 4145 2627