So far, we have identified several types of decision constructs that are available in Java. For example, simple decisions are easily handled using a
if statement. Either-or type of decisions can be addressed using a
else if clause or a
The proper use of control structures is paramount in developing good code. However, there is more to making decisions than simply choosing between different control constructs. We also need to test our assumptions and handle unexpected situations.
In this section we will start by addressing a few general issues that you should keep in mind when using decision constructs. This will be followed by an examination of various floating point issues that can prove troublesome to ...