Apex - Decision Making

Decision-making structures require that the programmer specify one or more conditions to be evaluated or tested by the program, along with a statement or statements to be executed if the condition is determined to be true, and optionally, other statements to be executed if the condition is determined to be false.
In this chapter, we will be studying the basic and advanced structure of decision-making and conditional statements in Apex. Decision-making is necessary to control the flow of execution when certain condition is met or not. Following is the general form of a typical decision-making structure found in most of the programming languages
Decision Making
Sr.No.Statement & Description
1if statement
An if statement consists of a Boolean expression followed by one or more statements.
2if...else statement
An if statement can be followed by an optional elsestatement, which executes when the Boolean expression is false.
3if...elseif...else statement
An if statement can be followed by an optional else if...else statement, which is very useful to test various conditions using single if...else if statement.
4nested if statement
You can use one if or else if statement inside another if or else if statement(s).

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