MCQ- Java thread


Q) Thread synchronization in a process will be required when
  1. All threads sharing the same address space
  2. All threads sharing the same global variables
  3. All threads sharing the same files
  4. All

Answer: 4


Q) Which thread will be executed first if two threads have same priority
  1. They will fall in starvation and none will be executed.
  2. Both will be executed simultaneously
  3. It depends upon operating system
  4. They will be executed on first come first serve basis

Answer: 3


Q) The life cycle of a thread in java is controlled by
  1. JRE
  2. JDK
  3. JVM
  4. None

Answer: 3


Q) Which method is used to get current running thread object?
  1. runningThread()
  2. currentThread()
  3. runnableThread()
  4. None

Answer: 2


MCQ- Java thread

Scroll to top