About Question enthuware.ocpjp.v7.2.1391 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
icepeanuts
Posts: 53
Joined: Thu Nov 22, 2012 12:01 am
Contact:

About Question enthuware.ocpjp.v7.2.1391 :

Post by icepeanuts »

I am just curious to know if class JerkyThread correctly overrides run() method because its implementation uses synchronized keyword. However, class Thread's run() does not have it.

admin
Site Admin
Posts: 10389
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

Yes, it is alright for a subclass to add synchronized keyword to an overridden method.

HTH,
Paul.

icepeanuts
Posts: 53
Joined: Thu Nov 22, 2012 12:01 am
Contact:

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

Post by icepeanuts »

thanks

Alexey Berezkin
Posts: 20
Joined: Fri Jun 19, 2015 9:17 am
Contact:

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

Post by Alexey Berezkin »

Is it OK that we don't take into considerations possible things with per-thread variables caching? I mean, when we have 2 threads which a) access some variable without synchronization and b) this variable is not marked volatile — then the update issued by one thread may be not seen by the second one. This behaviour is not taken into consideration thoughout all the tests. (If taken, in this question answer 0 2 2 is also possible). Is it intentional omission that also exists on the real exam?

admin
Site Admin
Posts: 10389
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

We haven't see candidates getting question on volatile but you are right. The question should take into account this possibility. Either the variable should be made volatile or the getData method should be made synchronized.

We will check other questions as well to make sure this point is covered.

thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests