Q) Execution of a java thread begins on which method call?
  1. Start ()
  2. Run ()
  3. Execute ()
  4. Launch ()

Answer: 1
On thread start method create a thread and execute it. Note that thread start() method calls run() method internally.


Q) How many ways a thread can be created in Java multithreading?
  1. 1
  2. 2
  3. 3
  4. 4

Answer: 2
Threads in Java multithreading can be created in two ways. First, by implementing runnable interface and second as by extending thread class.
Read two ways to create java thread with example program


Q) Which statements is/are correct
  1. On calling Thread start () method a new thread get created.
  2. Thread start () method call run () method internally
  3. Thread run () method can also be called directly to create thread.
  4. All correct

Answer: 1 and 2
Notes: Thread run method can be called directly, but, it will behave as a normal method and will not create any thread.


Q) Which method is used to make main thread to wait for all child threads
  1. Join ()
  2. Sleep ()
  3. Wait ()
  4. Stop ()

Answer: 1


Q) Default value of a java thread is
  1. 0
  2. 1
  3. 5
  4. 10

Answer: 3
Default priority of thread is = 5. And minimum Priority = 1 & maximum Priority = 10.


Related Posts