next up previous
Next: Blocks Up: The Union and Composite Previous: Defining Instance Methods for

Conditional Statements

In the definition of the findAddress method, we used an conditional statement of the form:

if (test) consequent else alternative
where test is an expression of boolean type and consequent and alternative are statements. Conditional statements are used to classify program values into disjoint sets or regions using logical tests that we call claims. In simple example given above, we distinguished between two claims:
name.equals(first.name)
and
!(name.equals(first.name))



Corky Cartwright 2004-02-05