Summary
Now that you can use conditional statements, the overall intelligence of your Java programs has improved greatly. Your programs can now evaluate information and use it to react differently in different situations, even if information changes as the program is running. They can decide between two or more alternatives based on specific conditions. Programming a computer forces you to break a task down into a logical set of steps to undertake and decisions that must be made. Using the if statement and other conditionals in coding also promotes a type of logical thinking that can reap benefits in other aspects of your life:
- "If he is elected president in November, I will seek a Cabinet position, else I will move to Canada."
- "If my blind date is attractive, I'll pay for dinner at an expensive restaurant, else we will go to Pizza Hut."
- "If I violate my probation, the only team that will draft me is the Dallas Cowboys."
|