J2EEOnline
GofPatterns OOPortal
prev next
  Course navigation
Creating Starting Java Thread - Quiz

Creating and starting a thread
Each question is worth one point. Select the best answer or answers for each question.
 

1. The following code will successfully create and start a new thread
Please select the best answer.
  A. Thread t = new Thread();
  B. Thread t = new Thread(); t.run();
  C. Thread t = new Thread(); t.start();

2. To write a thread class that will do something useful, you should
Please select the best answer.
  A. Make sure to start it
  B. Create a subclass of a thread
  C. Supply a run() method for the thread

3. The best way to halt a thread (defined, for example, in a variable named t) is to write
Please select the best answer.
  A. t.destroy();
  B. t.stop();
  C. t.terminate();

Score =
Correct answers: