Agreed that the API docs are not clear on this topic. But for the record, Oracle's official tutorial docs do list it as three states:The exam has questions that require you to know valid states but it is not clear whether invalid is considered a state or not.
https://docs.oracle.com/javase/tutorial ... ml#processA watch key has a state. At any given time, its state might be one of the following:
- Ready indicates that the key is ready to accept events. When first created, a key is in the ready state.
- Signaled indicates that one or more events are queued. Once the key has been signaled, it is no longer in the ready state until the reset method is invoked.
- Invalid indicates that the key is no longer active. This state happens when one of the following events occurs:
- ◦ The process explicitly cancels the key by using the cancel method.
◦ The directory becomes inaccessible.
◦ The watch service is closed.
From the look of it I think I would be inclined to count it as one if the question were to come up.