The if-else Statement
An else clause can be added to an if statement to make it an if-else statement:
if (condition)
statement1;
else
statement2;
If the condition is true, statement1 is executed; if the condition is false, statement2 is executed
See Temperature3.java and Right_Triangle.java
Previous slide
Next slide
Back to first slide
View graphic version