An if statement lets a method choose a path at runtime based on a boolean condition. Writing conditions in the right order—and flattening nested ifs into early returns—keeps decision logic readable and bug-free.
More lessons in Complete Core Java