JavaDeploy
SiteMap
Java Certification
Java Beans
Java-OO Concepts
Java Multitasking
«Prev
Next»
Java Basics
System Object Model
Interfaces Packages
Describe Java Package
Importing Packages
Access Control
Interface Role
Reclaiming Memory
Garbage Collection
Forcing GarbageCollection
Project Access Control
OOA Concepts
Java Exceptions
Exceptions - Quiz
Catching Exceptions-Quiz
Finally-Keyword -Quiz
Throwing Exceptions - Quiz.
Catching Exceptions Baseball
Common Java Exceptions
122
Java Multitasking
Using Join for Threads
Starting JavaThread - Quiz
Coordinating Java Threads - Quiz
Thread States -Quiz
Intro Java Input/Output
Java Io Package
Java System.in Read Input
Data Input Stream
File Class To Access Files
Save Restore Draw Applet Project
Java Class Input Output Review
Java Stream Programming Conclusion
Coordinating Threads in Java - Quiz
Each question is worth one point. Select the best answer or answers for each question.
1.
When used with an instance method, the keyword
synchronized
ensures
Please select the best answer.
A.
That method can be invoked only by one thread at a time
B.
An exception is thrown if more than one thread tries to invoke the method
C.
There are no restrictions on invoking that method
2.
To lock only a portion of a method, you can write code like this
Please select the best answer.
A.
synchronized { /* code here */ }
B.
synchronized (void) { /* code here */ }
C.
synchronized (myObject) { /* code here */ }
3.
A thread is at a wait statement and is notified by another thread that has the lock on that object to proceed.
Under what conditions can the thread at the wait statement continue?
A.
Right away. It has been notified, and it can now go.
B.
The wait thread can continue once the notify thread has exited its synchronized block.
C.
The thread can continue once the notify thread has exited its synchronized block, and the wait thread has obtained the lock on that object.
Your score is 0.0
Submit
Quiz Explanation