next up previous
Next: 1.6 Basic Program Design Up: 1.5 The Union and Previous: 1.5.3 Defining Instance Methods

1.5.4 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
2000-01-07