Conditional Expressions
Learn how to control the flow of code execution with conditional expressions!
StartKey Concepts
Review core concepts you need to learn to master this subject
If Expressions
Else Expressions
Else-If Expressions
Comparison Operators
Logical Operators
The AND Operator: &&
The OR Operator : ||
The NOT Operator: !
If Expressions
If Expressions
var morning = true
if (morning) {
println("Rise and shine!")
}
// Prints: Rise and shine!
An if
expression is a conditional that runs a block of code when its condition has a true
value.
Conditional Expressions
Lesson 1 of 1
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory