Java Thread Quiz

Description: Java Thread Quiz
Number of Questions: 8
Created by:
Tags: java
Attempted 0/8 Correct 0 Score 0
  1. init();

  2. start();

  3. run();

  4. resume();

Correct Option: B

The start() method causes this thread to begin execution; the Java Virtual Machine calls the run method of this thread.

Which cannot directly cause a thread to stop executing?

  1. Calling the SetPriority() method on a Thread object.

  2. Calling the wait() method on an object.

  3. Calling notify() method on an object.

  4. Calling read() method on an InputStream object.

Correct Option: C

notify() - wakes up a single thread that is waiting on this object's monitor.

  1. wait()

  2. notify()

  3. notifyall()

  4. exits synchronized code

Correct Option: A
  1. void run()

  2. public void run()

  3. public void start()

  4. void run(int priority)

Correct Option: B
  1. run();

  2. start();

  3. stop();

  4. main();

Correct Option: A

Which method registers a thread in a thread scheduler?

  1. run();

  2. construct();

  3. start();

  4. register();

Correct Option: C
  1. notify()

  2. wait()

  3. InputStream access

  4. sleep()

Correct Option: A
- Hide questions