If-else statements allow code to execute based on boolean conditions. Java also supports ternary operators.
← Core Java theorytheory 0/50 · 0%
Fundamentals · easy
4. Control Flow: If-Else
Conditional branching in Java.
Check your understanding
1. What is the result of (5 > 3) ? 'A' : 'B'?
2. Can 'if' work without 'else'?