Skip to content

Commit b236a87

Browse files
author
davidcok
committed
Editing
1 parent 71dad0d commit b236a87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tutorial/MultipleBehaviors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ We could even separate out two kinds of exceptions:
5858
```
5959
Now the `signals_only` clause allows the two kinds of exceptions, although the specification does not say when each one is thrown. We could go to one more level of specification detail to stipulate that each exception is thrown just when the appropriate argument validation check fails. Try it as an exercise. There is a question though: what if both checks fail? Should the specification state which exception is thrown in preference to the other? If it does it is constraining the implementation, perhaps overly so.
6060

61-
## Specialized behaviors
61+
## <a name="SpecializedBehaviors"></a>Specialized behaviors
6262

6363
The normal and exceptional behaviors illustrated in the previous section are very common, so much so that they have specialized syntax: `normal_behavior` and `exceptional_behavior`. We can rewrite the previous example as
6464
```
@@ -69,7 +69,7 @@ A behavior that is neither of these is a simple `behavior`, which is the default
6969

7070
One other point: any one of the behavior keywords needs a visibility keyword; almost always, as in the example above, the visibility is the same as the method. The absence of a visibility modifier means `package` visibility, just as the absence of a visibility modifier on the method declaration. However, if there is no specialized behavior keyword, then there is no place for the visibility keyword; in that case, the visibility is the same as the visibility of the method.
7171

72-
## <a name="SpecializedBehaviors"></a>Summary of specification cases
72+
## Summary of specification cases
7373

7474
To summarize, a method may have multiple specification cases.
7575
* They are separated/connected by the `also` keyword.

0 commit comments

Comments
 (0)