Java Multithreading Question and Answers

17. What methods must be implemented by all threads?
  All tasks must implement the run() method, whether they are a subclass of Thread or implement the Runnable interface.
 
Your Name Your Email-ID
Your Answer
18. How can multiple threads be controlled simultaneously?
  If you create threads in a ThreadGroup object, they may be controlled simultaneously with the member function of said object.
 
Your Name Your Email-ID
Your Answer
19. What is the class and interface in java to create thread and which is the most advantageous method?
  Thread class and Runnable interface can be used to create threads and using Runnable interface is the most advantageous method to create threads because we need not extend thread class here.
 
Your Name Your Email-ID
Your Answer
20. What are the states associated in the thread?
  Thread contains
  • ready
  • running
  • waiting and
  • dead state
 
Your Name Your Email-ID
Your Answer
12345678910 Page 5 of 10