← Back to Subject
OOP Using Java • MCQ • Multithreading
Most Important 30 Objective Question - Multithreading
Q1. What is multithreading in Java?
A) Running multiple programs
B) Running multiple threads simultaneously
C) Running only one method
D) Running only main() method

Answer: B) Running multiple threads simultaneously
Explanation:Multithreading allows multiple threads to execute at the same time and improves CPU utilization.

Q2. A thread is:
A) A lightweight process
B) A package
C) A constructor
D) A class only

Answer: A) A lightweight process
Explanation:A thread is called a lightweight process because it uses fewer resources than a full process.

Q3. Which class is used to create a thread?
A) String
B) Thread
C) Scanner
D) System

Answer: B) Thread
Explanation:The Thread class is used to create and manage threads in Java.

Q4. Which interface is used to create a thread?
A) Serializable
B) Runnable
C) Cloneable
D) Comparable

Answer: B) Runnable
Explanation:The Runnable interface provides another way to create threads.

Q5. Which method starts a thread?
A) run()
B) start()
C) execute()
D) begin()

Answer: B) start()
Explanation:The start() method starts a new thread and internally calls run().

Q6. Which method contains the code executed by a thread?
A) main()
B) stop()
C) run()
D) finalize()

Answer: C) run()
Explanation:The run() method contains the task performed by the thread.

Q7. Which thread starts automatically when Java program runs?
A) Child Thread
B) Main Thread
C) Runnable Thread
D) Final Thread

Answer: B) Main Thread
Explanation:The main thread starts automatically when the Java program begins execution.

Q8. Which method is used to pause a thread for some time?
A) wait()
B) stop()
C) sleep()
D) notify()

Answer: C) sleep()
Explanation:sleep() pauses the execution of a thread for a specific time.

Q9. Which method is used to stop interruption request?
A) interrupt()
B) destroy()
C) break()
D) exit()

Answer: A) interrupt()
Explanation:interrupt() is used to interrupt a running thread.

Q10. Which method is used to check whether a thread is alive?
A) isRunning()
B) isAlive()
C) alive()
D) check()

Answer: B) isAlive()
Explanation:isAlive() returns true if the thread is still running.

Q11. Which of the following is the highest thread priority?
A) 1
B) 5
C) 10
D) 15

Answer: C) 10
Explanation:Java thread priority ranges from 1 to 10, where 10 is maximum priority.

Q12. Default thread priority is:
A) 1
B) 5
C) 10
D) 0

Answer: B) 5
Explanation:The default priority of a thread in Java is 5 (NORM_PRIORITY).

Q13. Which method is used to set thread priority?
A) priority()
B) setPriority()
C) setThread()
D) changePriority()

Answer: B) setPriority()
Explanation:setPriority() assigns priority to a thread.

Q14. Which method waits for a thread to complete?
A) sleep()
B) join()
C) stop()
D) yield()

Answer: B) join()
Explanation:join() makes one thread wait until another thread finishes.

Q15. Which method gives chance to another thread of same priority?
A) yield()
B) sleep()
C) join()
D) stop()

Answer: A) yield()
Explanation:yield() pauses the current thread and gives execution chance to another thread.

Q16. Which concept is used to control access of multiple threads to shared resources?
A) Inheritance
B) Synchronization
C) Encapsulation
D) Polymorphism

Answer: B) Synchronization
Explanation:Synchronization is used to avoid data inconsistency when multiple threads access shared resources.

Q17. Which keyword is used for synchronization in Java?
A) final
B) synchronized
C) static
D) private

Answer: B) synchronized
Explanation:The synchronized keyword is used to make methods or blocks thread-safe.

Q18. Which problem occurs without synchronization?
A) Compilation Error
B) Race Condition
C) Syntax Error
D) Package Error

Answer: B) Race Condition
Explanation:Without synchronization, multiple threads may modify shared data incorrectly, causing race condition.

Q19. Which method is used for inter-thread communication?
A) wait()
B) notify()
C) notifyAll()
D) All of these

Answer: D) All of these
Explanation:wait(), notify(), and notifyAll() are used for communication between threads.

Q20. Which method causes current thread to wait?
A) notify()
B) wait()
C) sleep()
D) join()

Answer: B) wait()
Explanation:wait() makes the current thread wait until another thread notifies it.

Q21. Which method wakes up one waiting thread?
A) notify()
B) stop()
C) interrupt()
D) yield()

Answer: A) notify()
Explanation:notify() wakes up a single waiting thread.

Q22. Which method wakes up all waiting threads?
A) notify()
B) notifyAll()
C) wakeAll()
D) resume()

Answer: B) notifyAll()
Explanation:notifyAll() wakes up all threads waiting on the same object.

Q23. Which thread state means thread is ready to run?
A) New
B) Runnable
C) Dead
D) Waiting

Answer: B) Runnable
Explanation:Runnable state means the thread is ready and waiting for CPU time.

Q24. Which thread state means thread has finished execution?
A) New
B) Runnable
C) Terminated
D) Waiting

Answer: C) Terminated
Explanation:After completing execution, the thread enters the terminated (dead) state.

Q25. Which state is before start() method is called?
A) Runnable
B) New
C) Waiting
D) Blocked

Answer: B) New
Explanation:When a thread object is created but start() is not called, it remains in New state.

Q26. Which of the following is NOT a thread state?
A) New
B) Running
C) Deleted
D) Runnable

Answer: C) Deleted
Explanation:Deleted is not a valid Java thread state.

Q27. Multiple processes share:
A) Same memory
B) Different memory
C) Same thread
D) Same constructor

Answer: B) Different memory
Explanation:Processes are independent and use separate memory spaces.

Q28. Multiple threads share:
A) Different memory
B) Separate JVM
C) Same memory
D) Different classes

Answer: C) Same memory
Explanation:Threads of the same process share the same memory space.

Q29. Which is faster?
A) Process creation
B) Thread creation
C) Both same
D) Constructor creation

Answer: B) Thread creation
Explanation:Thread creation is faster because threads use fewer resources than processes.

Q30. Multithreading improves:
A) CPU utilization
B) Program performance
C) Responsiveness
D) All of these

Answer: D) All of these
Explanation:Multithreading improves CPU usage, speed, and responsiveness of programs.
Google AdSense Ad Placement Here 📢