next up previous
Next: The if-else statement Up: Unit 05 Previous: Statements in Java

Conditional statements

Java, like all other programming languages, is equipped with specific statements that allow us to check a condition and execute certain parts of code depending on whether the condition is true or false. Such statements are called conditional, and are a form of composite statement.

In Java, there are two forms of conditional statements:


next up previous
Next: The if-else statement Up: Unit 05 Previous: Statements in Java