MultiThreaded Programming  «Prev  Next»

Multithreaded Java Programming - Quiz

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

1. To start the execution of a thread after you create it, you must:
Please select the best answer.
  A. Call the run() method
  B. Call the start() method
  C. Do nothing--threads start automatically upon creation

2. What method in the Thread class do you call to make the current thread cease executing for a specified amount of time?
Please select the best answer.
  A. sleep()
  B. pause()
  C. stop()

3. You designate a method as being synchronized by:
Please select the best answer.
  A. A. Using the synchronized keyword
  B. B. Placing a synchronized section of code within it
  C. C. Naming the method synchronize

Java Concurrency
4. What is the primary drawback to using synchronized methods?
Please select the best answer.
  A. They take longer to compile than unsynchronized methods.
  B. They compile into larger executable bytecode than unsynchronized methods.
  C. They are less efficient than unsynchronized methods.

Your score is 0.0