Page 1 of 1

About Question enthuware.ocpjp.v7.2.1525 :

Posted: Tue May 14, 2013 12:02 am
by ilkinesrefli
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.
Because documentation wrote:A 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:
    1. The process explicitly cancels the key by using the cancel method.
    2. The directory becomes inaccessible.
    3. The watch service is closed.
http://docs.oracle.com/javase/tutorial/ ... ation.html

Re: About Question enthuware.ocpjp.v7.2.1525 :

Posted: Wed May 15, 2013 6:30 am
by admin
Yes, and the explanation mentions the same point.

HTH,
Paul.

Re: About Question enthuware.ocpjp.v7.2.1525 :

Posted: Fri May 17, 2013 3:50 am
by ilkinesrefli
But this question or answer is wrong. Documentation says WatchKey have ready, signaled, invalid states. Please correct mistake for this question(2.1525).

Re: About Question enthuware.ocpjp.v7.2.1525 :

Posted: Fri May 17, 2013 6:10 am
by admin
The reason "Invalid" is not marked as correct is because the JavaDoc (which is the official documentation) does not clearly mention invalid as a state. Here is what it says:
When initially created the key is said to be ///ready///. When an event is detected then the key is ///signaled/// and queued so that it can be retrieved by invoking the watch service's poll or take methods. Once signalled, a key remains in this state until its reset method is invoked to return the key to the ready state."
It does mention invalid in the description of cancel method.

However, in light of the tutorial link that've mentioned, I think it is better to mark invalid as a right option as well. This has now been update.

thank you for your feedback!
Paul.

Re: About Question enthuware.ocpjp.v7.2.1525 :

Posted: Tue May 21, 2013 7:22 am
by ilkinesrefli
Hello, when this question will be updated? There is no new version of question bank.

Re: About Question enthuware.ocpjp.v7.2.1525 :

Posted: Tue May 21, 2013 8:07 am
by admin
The version number was updated today. Please check now.

HTH,
Paul.