Page 1 of 1
About Question enthuware.ocpjp.v7.2.2009 :
Posted: Wed Oct 09, 2013 10:57 am
by Student
Really, are we expected to remember this level of minutiae?

Where does it end..if the return type for this method, why not all methods in this class, or all methods in all classes in this package etc.
Yours disgruntledly etc....
Re: About Question enthuware.ocpjp.v7.2.2009 :
Posted: Wed Oct 09, 2013 11:06 am
by admin
Yes, you need to know the API for these methods really good. Can't do much about it.
HTH,
Paul.
Re: About Question enthuware.ocpjp.v7.2.2009 :
Posted: Fri Jan 06, 2017 1:22 pm
by jagoneye
Student wrote:Really, are we expected to remember this level of minutiae?

Where does it end..if the return type for this method, why not all methods in this class, or all methods in all classes in this package etc.
Yours disgruntledly etc....
This is nothing compared to collections where there are different return types for same named methods of different implementation classes!

Re: About Question enthuware.ocpjp.v7.2.2009 :
Posted: Sat Sep 30, 2017 3:38 am
by BarrettC
Reading the OCJP 1Z0-809 objectis, this is not in there. Is there a specific reason it is in the practice exams for the 1ZO-809 I purchased?
Re: About Question enthuware.ocpjp.v7.2.2009 :
Posted: Sun Oct 01, 2017 8:23 pm
by admin
It is not mentioned explicitly in the exam objectives but some candidates have reported getting a question on it. That is why we have included it in the question bank.
HTH,
Paul.
Re: About Question enthuware.ocpjp.v7.2.2009 :
Posted: Mon Nov 05, 2018 7:19 am
by aronia2
Hello,
Let's assume that the code uses trylock() and it compiles fine.
What is confusing for me is that the code invokes trylock() twice without calling unlock().
Shouldn't we get some sort of an Exception in this kind of situation?
Best Regards!
Re: About Question enthuware.ocpjp.v7.2.2009 :
Posted: Mon Nov 05, 2018 8:30 am
by admin
Check out the
API description of ReentrantLock
It says it is alright to acquire the same lock again.
The method will return immediately if the current thread already owns the lock.