Notes
In Apex, the if
statement is a control flow statement used for conditional execution of code. It allows you to specify a block of code to be executed if a given condition is true. The basic syntax of the if
statement is as follows:
if (condition) {
// Code to be executed if the condition is true
}
Here's a brief example:
Boolean doAddition = true;
Integer x=12;
Integer y=18;
Integer sum=0;
if (doAddition) {
sum = x +y;
}
System.debug(sum)
Output: 30
Video
Video does not exists.