Testing a Condition

Whenever a Java program makes a decision, it does so by employing a conditional statement. During this hour, you'll be checking the condition of several things in your Java programs using the conditional statements if, else, switch, case, and break. You also will be using several conditional operators: ==, !=, <, >, and ?, along with boolean variables.

Get SAMS Teach Yourself Programming with Java™ in 24 Hours, FOURTH EDITION now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.