A good answer might be:

Math.sin( 0.5 ) >= Math.tan( 0.2 ) || 43.259 / 12.073 > 3.5 || ( 100 > 45 )

There are no side-effects here, so it is safe to look at the last part:

( 100 > 45 )

and realize that the entire expression will be true. Java (working from left to right) might have found a different true, but in the absence of side-effects that doesn't matter. The entire expression is true.

Math functions, such as Math.sin() and Math.cos(), do not have side effects. They are safe to use in boolean expressions.

Red Miata Sports Car

Say that you have not yet given up on buying that $25,000 red Miata sports car. The sales manager of the car lot will let you buy the car if:

The logic of this situation is slightly complicated. Here are several situations:

Notice that it is not enough to merely have a high credit line. To buy the car on credit you must also be free of debt.


You have $25,000 in cash, $50,000 in credit and massive debts. Do you get the car?