About Question enthuware.ocpjp.v7.2.1525 :
Posted: Tue May 14, 2013 12:02 am
Hello, this question is confused. Maybe question must be "A WatchKey can be in which of the following valid states?" or answer must be 3(ready,signaled,invalid)
If watchkey.reset() returns false that means state is invalid.
If watchkey.reset() returns false that means state is invalid.
Because documentation wrote:A watch key has a state. At any given time, its state might be one of the following:
http://docs.oracle.com/javase/tutorial/ ... ation.html
- 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.