MultiThreaded Programming  «Prev  Next»

Multi-Threading Fundamentals in Java - Quiz

Each question is worth one point. Select the best answer or answers for each question.
 

1. A single sequence of code executing within a program is known as:
Please select the best answer.
  A. A method
  B. A process
  C. A thread

2. There are three Threads trying to invoke a method of an object. This method is a synchronized method to prevent conflict between Threads.
While Thread1 is executing the method, Thread2 and Thread3, in that order attempt to invoke the method.
What happens when Thread1 exits the method?
Please select the best answer.
  A. Thread2 will be the first waiting Thread to execute the method.
  B. Thread3 will be the first waiting Thread to execute the method.
  C. The order in which the Thread2 and Thread3 will invoke the method cannot be determined.


3. What method is declared in the Runnable interface and serves as the path of execution for all threads?
Please select the best answer.
  A. start()
  B. run()
  C. go()



Your score is 0.0