An if statement is a type of selection statement. A selection statement is a statement that only executes when a condition is true. A selection statement is also referred to as a conditional statement.

The condition of an if statement results in a Boolean value (either true or false) and determines whether or not to execute the block of code.