Shortcut Navigation:

Thread Option D Quiz

What is the name of the method used to start a thread execution?

Which two are valid constructors for Thread?  
  1. Thread(Runnable r, String name)
  2. Thread()
  3. Thread(int priority)
  4. Thread(Runnable r, ThreadGroup g)
  5. Thread(Runnable r, int priority)

Which three are methods of the Object class?  
  1. notify();
  2. notifyAll();
  3. isInterrupted();
  4. synchronized();
  5. interrupt();
  6. wait(long msecs);
  7. sleep(long msecs);
  8. yield();

Which of the following line of code is suitable to start a thread ?XRunnable class X implements Runnable{public static void main(String args[]){/* Missing code? */}public void run() {}}

Which cannot directly cause a thread to stop executing?

Which two of the following methods are defined in class Thread?  
  1. start()
  2. wait()
  3. notify()
  4. run()
  5. terminate()

Which three guarantee that a thread will leave the running state?  
  1. yield()
  2. wait()
  3. notify()
  4. notifyAll()
  5. sleep(1000)
  6. aLiveThread.join()
  7. Thread.killThread()

Which of the following will directly stop the execution of a Thread?

Which method must be defined by a class implementing the java.lang.Runnable interface?

Which will contain the body of the thread?