Programming - Threads
You Are Here :: Home > JAVA > Threads - General Questions
43.
______________________ is used to prevent data from being corrupted by multiple threads by a keyword synchronized to synchronize them and intercommunicate to each other.
A.
Synchronous Threads
B.
Asynchronous Threads
C.
Semaphore
D.
Both A and B
Answer: Option C
Explanation:
semaphore? to prevent data from being corrupted by multiple threads by a keyword synchronized to synchronize them and intercommunicate to each other.
44.
Java's _________________ is used to ensure that only one thread is in acritical region.
A.
Synchronized
B.
Asynchronous Threads
C.
Semaphore
D.
Assertions
Answer: Option A
Explanation:
Java's synchronized is used to ensure that only one thread is in acritical region.
45.
______________________ term refers to the access granted to a particular thread that can access the shared resources.
A.
Lock
B.
Unlock
C.
both A and B
D.
none
Answer: Option A
Explanation:
Lock term refers to the access granted to a particular thread that can access the shared resources.
46.
Only one thread at a time can access the shared resource guarded by the ___________________ lock.
A.
Class
B.
Object
C.
Variable
D.
Method
Answer: Option B
Explanation:
Only one thread at a time can access the shared resource guarded by the object lock.
47.
Any method is specified with the keyword synchronized is only executed by ___________________ thread at a time.
A.
one
B.
two
C.
three
D.
multiple
Answer: Option A
Explanation:
Any method is specified with the keyword synchronized is only executed by one thread at a time.
48.
________________________ statements must specify the object that provides the native lock.
A.
Synchronized
B.
Asynchronized
C.
both A and B
D.
none
Answer: Option A
Explanation:
Synchronized statements must specify the object that provides the native lock.
« prev
next »