Key Concepts

Review core concepts you need to learn to master this subject

else Statement

boolean condition1 = false; if (condition1){ System.out.println("condition1 is true"); } else{ System.out.println("condition1 is not true"); } // Prints: condition1 is not true

The else statement executes a block of code when the condition inside the if statement is false. The else statement is always the last condition.

Conditionals and Control Flow
Lesson 1 of 2

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo