What is the relationship between synchronized code and code that is locked using a ReentrantLock object?
A) synchronized code stops the race condition, locks do not.
B) synchronized is a single lock, but we may have many ReentrantLock objects.
C) The two are exactly the same.
D) The two concepts are not related.
Correct Answer:
Verified
Q71: Class MyClass has a single ReentrantLock object,
Q72: Consider an old fashioned telephone booth that
Q73: Class MyClass has two ReentrantLock objects, myLock1
Q74: Assume two threads share a BankAccount object
Q75: Assume three threads share a BankAccount object
Q76: The term "stale data" refers to a
Q78: Which of the following scenarios may not
Q79: The term "stale data" refers to a
Q80: Calling signalAll without locking the object is
Q81: In order to unblock a thread after
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents