Control Flow Statements
Conditional Statements
Java supports if
, else if
, else
, and switch
statements to manage the flow of a program.
Looping Statements
Loops like for
, while
, and do-while
allow repetitive tasks until a condition is met. For example: