Core Java theorytheory 0/50 · 0%
Fundamentals · easy

4. Control Flow: If-Else

Conditional branching in Java.

If-else statements allow code to execute based on boolean conditions. Java also supports ternary operators.

Check your understanding

  1. 1. What is the result of (5 > 3) ? 'A' : 'B'?

  2. 2. Can 'if' work without 'else'?