Keywords: current

Next: 1.4.5 Blocks Up: 1.4 The Union and Previous: 1.4.3 Defining Instance Methods

## 1.4.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))`