next up previous
Next: Basic Program Design 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) then 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
1999-09-07