Java multithreading and concurrency are core pillars for building high-performance, responsive applications that execute multiple tasks simultaneously. Utilizing the java.util.concurrent package, developers can manage thread lifecycles, leverage thread pools via Executor services, and implement thread-safe data structures without manual monitor synchronization. Mastery of concepts like synchronization, locks, volatile variables, and atomic operations is essential for avoiding race conditions, deadlocks, and memory inconsistency errors. These concepts form the bedrock of robust enterprise software development and technical interviews.
Java Multithreading & Concurrency MCQs
1 min read
Correct Answer: d) Extending the Runnable class
Explanation:
Runnable is an interface, not a class. Therefore, it must be implemented, not extended.
Correct Answer: b) start()
Explanation:
The start() method is used to begin execution of a thread. It internally calls the run() method in a new call stack.
Correct Answer: d) The run() method executes in the current thread
Explanation:
Calling run() directly does not create a new thread. It simply executes the method within the current thread's call stack like a normal method call.
Correct Answer: b) NEW
Explanation:
A thread is in the NEW state after it is instantiated but before its start() method is invoked.
Correct Answer: c) Thread.sleep()
Explanation:
Thread.sleep(milliseconds) pauses the currently executing thread for the specified amount of time.
Correct Answer: b) synchronized
Explanation:
The synchronized keyword ensures that only one thread can execute a block of code or method at a time for a given object lock.
Correct Answer: c) The object instance lock
Explanation:
A synchronized non-static method acquires the intrinsic lock of the object instance it is invoked on.
Correct Answer: b) The Class object lock
Explanation:
A synchronized static method acquires the lock of the Class object associated with the class, not the instance.
Correct Answer: b) InterruptedException
Explanation:
Thread.sleep() throws a checked InterruptedException if the sleeping thread is interrupted.
Correct Answer: b) To ensure visibility of updates to variables across threads
Explanation:
The volatile keyword guarantees that changes made to a variable by one thread are immediately visible to other threads by reading directly from main memory.
Correct Answer: b) No, it only guarantees visibility
Explanation:
volatile ensures visibility but not atomicity. Operations like count++ involve read, update, and write, which can still be interleaved between threads.
Correct Answer: c) join()
Explanation:
The join() method allows one thread to wait until another thread completes its execution.
Correct Answer: c) Hints to the scheduler that the current thread is willing to yield its current use of a processor
Explanation:
yield() is a hint to the thread scheduler to pause the current thread and allow other threads of the same or higher priority to execute.
Correct Answer: c) Object
Explanation:
These inter-thread communication methods are defined in the java.lang.Object class because they require acquiring the object monitor lock.
Correct Answer: a) The thread must own the object monitor lock
Explanation:
A thread must have acquired the intrinsic lock of the object via a synchronized block or method before calling wait(), notify(), or notifyAll().
Correct Answer: b) IllegalMonitorStateException
Explanation:
If a thread attempts to call wait() or notify() without holding the lock for the object, an IllegalMonitorStateException is thrown.
Correct Answer: b) wait() releases the lock, sleep() holds the lock
Explanation:
When wait() is called, the thread releases the lock it holds on the object. sleep() pauses the thread but keeps all locks acquired.
Correct Answer: c) To handle spurious wakeups
Explanation:
Threads can sometimes wake up without notify() being called due to spurious wakeups. The while loop ensures the condition is re-checked upon waking up.
Correct Answer: c) The Garbage Collector thread
Explanation:
Daemon threads run in the background. The JVM exits when all non-daemon user threads finish, regardless of daemon threads.
Correct Answer: a) By calling setDaemon(true) before starting the thread
Explanation:
You must call setDaemon(true) on a Thread instance before calling start(). Doing it after throws an IllegalThreadStateException.
Correct Answer: b) Callable
Explanation:
Callable is similar to Runnable but its call() method returns a result and can throw a checked exception.
Correct Answer: c) V (Generic Type)
Explanation:
The Callable interface is parameterized (Callable), and its call() method returns an object of type V.
Correct Answer: c) Future
Explanation:
When an ExecutorService submits a Callable, it returns a Future object, which can be used to retrieve the result using the get() method.
Correct Answer: b) Blocks the current thread until the result is available
Explanation:
Future.get() is a blocking call. It will halt the calling thread until the computation is complete and the result is available.
Correct Answer: b) Executor Framework
Explanation:
The Executor Framework (java.util.concurrent) simplifies thread management by providing thread pools to execute tasks asynchronously.
Correct Answer: b) Executors
Explanation:
The Executors utility class provides factory methods like newFixedThreadPool, newCachedThreadPool, and newSingleThreadExecutor.
Correct Answer: c) newFixedThreadPool()
Explanation:
Executors.newFixedThreadPool(n) creates a pool with exactly n threads. Tasks wait in a queue if all threads are busy.
Correct Answer: a) newCachedThreadPool()
Explanation:
newCachedThreadPool creates an expandable thread pool that kills idle threads after 60 seconds of inactivity.
Correct Answer: b) To execute tasks after a given delay, or periodically
Explanation:
ScheduledExecutorService provides methods like schedule(), scheduleAtFixedRate(), and scheduleWithFixedDelay() for timed executions.
Correct Answer: b) The thread terminates, but the application continues if other user threads are alive
Explanation:
An unhandled exception terminates that specific thread. Other threads continue running normally.
Correct Answer: b) Use Thread.setDefaultUncaughtExceptionHandler()
Explanation:
Uncaught exceptions in a thread can be handled by setting an UncaughtExceptionHandler on the thread or globally.
Correct Answer: b) When two or more threads access shared data concurrently and the outcome depends on thread scheduling
Explanation:
A race condition occurs when concurrent threads perform interleaved operations on shared data, leading to unpredictable and incorrect results.
Correct Answer: a) When all threads are blocked waiting for a lock that is held by another thread in the cycle
Explanation:
Deadlock happens when two or more threads hold locks and wait for locks held by each other, forming a cyclic dependency where none can proceed.
Correct Answer: d) Thread Starvation
Explanation:
The four Coffman conditions for deadlock are: Mutual Exclusion, Hold and Wait, No Preemption, and Circular Wait. Starvation is a different issue.
Correct Answer: a) A thread is unable to gain regular access to shared resources and is unable to make progress
Explanation:
Starvation occurs when a thread is constantly skipped by the scheduler or cannot acquire locks because other threads keep acquiring them first.
Correct Answer: b) Threads constantly change state in response to each other without making any real progress
Explanation:
In a livelock, threads are actively running and responding to each other, but they fall into a repetitive loop and make no actual progress.
Correct Answer: b) ThreadLocal
Explanation:
The ThreadLocal class enables you to create variables that can only be read and written by the same thread, preventing shared state issues.
Correct Answer: b) Initiates an orderly shutdown where previously submitted tasks are executed, but no new tasks will be accepted
Explanation:
shutdown() allows currently running and queued tasks to finish, but rejects new task submissions.
Correct Answer: b) Attempts to stop all actively executing tasks and halts processing of waiting tasks
Explanation:
shutdownNow() returns a list of tasks that were waiting to execute and attempts to interrupt threads that are currently executing tasks.
Correct Answer: c) java.util.concurrent.locks
Explanation:
ReentrantLock, ReadWriteLock, and Condition are located in the java.util.concurrent.locks package.
Correct Answer: c) Fairness parameter, tryLock(), and interruptible lock acquisition
Explanation:
ReentrantLock provides advanced features like polling via tryLock, interruptible lock waits, and fairness policies.
Correct Answer: a) Ensures the longest-waiting thread gets the lock next
Explanation:
If a ReentrantLock is instantiated with fair set to true, it favors granting access to the thread that has been waiting the longest.
Correct Answer: b) tryLock()
Explanation:
tryLock() attempts to get the lock. If it is free, it acquires it and returns true. If held by another thread, it immediately returns false.
Correct Answer: b) To allow concurrent access for read-only operations, while write operations require exclusive access
Explanation:
ReadWriteLock improves performance for read-heavy operations by allowing multiple reader threads to hold the read lock concurrently.
Correct Answer: c) await()
Explanation:
Condition.await() serves the same purpose as Object.wait(), allowing a thread to wait for a specific condition within a ReentrantLock.
Correct Answer: a) signalAll()
Explanation:
Condition.signalAll() wakes up all threads waiting on that specific Condition instance.
Correct Answer: c) Vector
Explanation:
Vector is a legacy collection class where all of its core methods are synchronized, making it inherently thread-safe.
Correct Answer: c) ConcurrentHashMap
Explanation:
ConcurrentHashMap partitions the map and locks only specific segments or bins, providing thread safety with very high concurrency compared to Hashtable.
Correct Answer: c) Mutative operations create a new copy of the underlying array
Explanation:
CopyOnWriteArrayList creates a fresh copy of the internal array for every write operation, making it ideal when reads vastly outnumber writes.
Correct Answer: c) BlockingQueue
Explanation:
BlockingQueue provides methods like put() and take() that block the thread if the queue is full or empty.
Correct Answer: c) put()
Explanation:
The put() method blocks the calling thread until space becomes available in a bounded BlockingQueue.
Correct Answer: c) take()
Explanation:
The take() method blocks the calling thread until an element is available to be removed from the BlockingQueue.
Correct Answer: b) To allow threads to wait until a set of operations in other threads completes
Explanation:
CountDownLatch is initialized with a count. Threads call await() to wait until the count reaches zero after other threads call countDown().
Correct Answer: a) CyclicBarrier can be reused after it trips, CountDownLatch cannot
Explanation:
A CyclicBarrier allows threads to wait for each other to reach a common barrier point and can be reset. CountDownLatch is used once.
Correct Answer: b) Semaphore
Explanation:
A Semaphore maintains a set of permits. Threads call acquire() to get a permit and release() to return it, limiting concurrent access.
Correct Answer: c) Blocks until a permit is available, then takes it
Explanation:
acquire() blocks the calling thread if no permits are available. Once available, it decrements the permit count and proceeds.
Correct Answer: a) Exchanger
Explanation:
Exchanger is a synchronization point where two threads can swap data. The first thread waits until the second arrives.
Correct Answer: b) Phaser
Explanation:
Phaser allows parties to dynamically register and deregister, and supports synchronization over multiple phases.
Correct Answer: c) Using Compare-And-Swap instructions
Explanation:
Atomic classes use low-level native Compare-And-Swap operations to perform lock-free, thread-safe variable updates.
Correct Answer: b) incrementAndGet()
Explanation:
incrementAndGet() atomically increments by one the current value and returns the new value.
Correct Answer: b) Compare And Swap
Explanation:
Compare-And-Swap is an atomic operation used in multithreading to achieve synchronization without traditional locks.
Correct Answer: c) Taking advantage of multiple processors by recursively splitting tasks into smaller subtasks
Explanation:
Fork/Join is tailored for CPU-intensive workloads that can be divided into smaller chunks and whose results can be combined.
Correct Answer: b) Work-stealing algorithm
Explanation:
In ForkJoinPool, idle threads steal tasks from the queues of busy threads, ensuring all CPU cores remain fully utilized.
Correct Answer: a) ForkJoinTask
Explanation:
ForkJoinTask is the base class. Developers typically extend its abstract subclasses RecursiveAction or RecursiveTask.
Correct Answer: b) RecursiveAction
Explanation:
RecursiveAction represents a computation that does not return a result, similar to Runnable.
Correct Answer: c) compute()
Explanation:
The compute() method contains the main computation logic and the rules for splitting the task.
Correct Answer: b) An extension of Future that supports functional, asynchronous, non-blocking programming
Explanation:
CompletableFuture implements Future and CompletionStage, allowing you to chain callbacks and compose asynchronous operations.
Correct Answer: b) runAsync()
Explanation:
CompletableFuture.runAsync(Runnable) executes the task in a background thread and returns a CompletableFuture of type Void.
Correct Answer: c) supplyAsync()
Explanation:
CompletableFuture.supplyAsync(Supplier) executes a task asynchronously and returns a CompletableFuture holding the result.
Correct Answer: b) thenAccept()
Explanation:
thenAccept(Consumer) takes the result of the previous stage, processes it, and returns a CompletableFuture of type Void.
Correct Answer: a) thenApply()
Explanation:
thenApply(Function) takes the result of the previous stage, applies a function, and returns a CompletableFuture with the transformed result.
Correct Answer: b) To provide high-performance concurrent random number generation without contention
Explanation:
ThreadLocalRandom isolates the state to each thread, avoiding synchronization overhead associated with java.util.Random.
Correct Answer: c) Timer can be killed by an unchecked exception in a task, killing all scheduled tasks
Explanation:
Timer relies on a single background thread. If one task throws an unchecked exception, the Timer thread dies, cancelling all other scheduled tasks.
Correct Answer: b) ThreadFactory
Explanation:
ThreadFactory provides a method to construct new threads, often used to set custom names, daemon status, or priorities.
Correct Answer: b) Call thread.interrupt() and handle InterruptedException or check isInterrupted()
Explanation:
The interrupt() method sets the thread interrupt status. The thread should routinely check Thread.interrupted() or catch InterruptedException to terminate gracefully.
Correct Answer: b) interrupted() is a static method that clears the interrupt flag; isInterrupted() is non-static and does not clear it
Explanation:
Thread.interrupted() checks the current thread status and clears the flag. instance.isInterrupted() checks a specific thread status but leaves the flag untouched.
Correct Answer: a) Calling start() on a thread that has already been started or has finished
Explanation:
Once a thread is started, it cannot be started again. Doing so throws an IllegalThreadStateException.
Correct Answer: b) try-finally
Explanation:
When using explicit locks like ReentrantLock, unlock() must be placed in a finally block to ensure the lock is released even if an exception is thrown.
Correct Answer: c) Yes, because the lock is reentrant, but it must be released the same number of times
Explanation:
A ReentrantLock allows the thread that currently owns the lock to re-acquire it multiple times. A hold count is maintained, so unlock() must be called an equal number of times.
Correct Answer: b) A guarantee that memory writes by one specific statement are visible to another specific statement
Explanation:
The happens-before relation in JMM guarantees memory visibility. If action A happens-before action B, changes made by A are visible to B.
Correct Answer: c) Unlocking a monitor lock happens-before every subsequent locking of that same monitor
Explanation:
The JMM specifies that an unlock operation on a monitor happens-before any subsequent lock operation on that same monitor.
Correct Answer: b) To efficiently implement a thread-safe Singleton design pattern
Explanation:
Double-checked locking checks if an instance is initialized without acquiring a lock first, optimizing the thread-safe initialization of a Singleton.
Correct Answer: b) AtomicBoolean
Explanation:
AtomicBoolean provides lock-free, atomic operations on a boolean value, making it perfect for concurrent flags.
Correct Answer: a) An integer from 1 to 10
Explanation:
Thread priorities are integers from Thread.MIN_PRIORITY (1) to Thread.MAX_PRIORITY (10).
Correct Answer: b) No, it is merely a hint to the underlying OS scheduler
Explanation:
Thread priorities are mapped to OS-level priorities, and the JVM cannot guarantee that a higher priority thread will execute before a lower priority one.
Correct Answer: b) Allows grouping of threads to manage them collectively
Explanation:
ThreadGroup provides a way to manage threads as a collective set, though its use is largely discouraged in favor of the Executor framework.
Correct Answer: b) ReentrantLock with multiple Condition objects
Explanation:
Unlike the intrinsic lock which has a single wait-set, a ReentrantLock can create multiple Condition objects, each providing its own wait-set.
Correct Answer: b) A thread modified a collection while it was being iterated using a fail-fast iterator
Explanation:
This runtime exception occurs when an object is concurrently modified while an iterator is iterating over it, without using the iterator own modification methods.
Correct Answer: c) CopyOnWriteArrayList
Explanation:
Collections in java.util.concurrent like CopyOnWriteArrayList use fail-safe iterators that operate on a snapshot and do not throw this exception.
Correct Answer: c) Callable can return a value and throw checked exceptions, Runnable cannot
Explanation:
Runnable run method has a void return type and cannot throw checked exceptions. Callable call method returns a generic value and throws Exception.
Correct Answer: b) submit()
Explanation:
The submit() method accepts a Callable or Runnable and returns a Future object representing the pending results of the task.
Correct Answer: a) Executes a collection of Callables and returns a list of Futures when all complete
Explanation:
invokeAll() executes a collection of Callable tasks, blocking until all tasks have completed, and returns a list of Future objects.
Correct Answer: c) Executes a collection of tasks and returns the result of the first one to successfully complete, cancelling the others
Explanation:
invokeAny() blocks until at least one task completes successfully, returns that result, and cancels remaining tasks.
Correct Answer: c) Future
Explanation:
The Future interface provides a cancel method to attempt to cancel execution of a submitted task.
Correct Answer: b) The thread executing the task should be interrupted if it is already running
Explanation:
If true, the executor will call interrupt() on the thread currently executing the task.
Correct Answer: c) Maintaining a sum efficiently under high contention
Explanation:
LongAdder provides much better performance than AtomicLong when updated concurrently by many threads.
Correct Answer: b) An enhanced ReadWriteLock that supports optimistic reading
Explanation:
StampedLock provides an optimistic read mode that does not block writers, which can highly optimize read-heavy scenarios.
Correct Answer: a) tryOptimisticRead()
Explanation:
tryOptimisticRead() returns a stamp that can later be validated to check if a write lock was acquired in the meantime.
Correct Answer: b) A snapshot of the state of all threads running in a JVM at a given time
Explanation:
A thread dump lists every active thread in the JVM along with its stack trace and state, essential for diagnosing deadlocks.
Correct Answer: b) Using the jstack command
Explanation:
The jstack command-line utility prints Java thread stack traces for a given Java process ID.
Correct Answer: b) The OS process of storing the state of a thread and restoring the state of another thread to run on the CPU
Explanation:
Context switching is how an OS multitasking system shares a single CPU among multiple threads, which carries a performance cost.
Correct Answer: b) Waiting to acquire an intrinsic monitor lock to enter a synchronized block
Explanation:
The BLOCKED state strictly means the thread is waiting for a monitor lock to enter or re-enter a synchronized block or method.
Correct Answer: b) WAITING
Explanation:
A thread is in the WAITING state when it is waiting indefinitely for another thread to perform a particular action.
Correct Answer: c) TIMED_WAITING
Explanation:
Methods that put a thread in a waiting state for a specified amount of time put the thread in the TIMED_WAITING state.
Correct Answer: b) Handles unchecked exceptions thrown by threads within that group
Explanation:
If a thread does not have a specific UncaughtExceptionHandler, the JVM forwards the exception to its ThreadGroup uncaughtException method.
Correct Answer: c) Yes, except for long and double unless declared volatile
Explanation:
64-bit primitives like long and double are written in two 32-bit operations, meaning they are not atomic unless declared volatile.
Correct Answer: a) Provides basic thread blocking and unblocking primitives
Explanation:
LockSupport provides low-level utility methods park() and unpark() to block and unblock a thread.
Correct Answer: b) No, constructors cannot be synchronized
Explanation:
Constructors cannot be synchronized because the object being constructed is only accessible by the thread creating it until the constructor completes.
Correct Answer: b) Yes, because the non-synchronized method does not require a lock
Explanation:
The intrinsic lock only restricts access to other synchronized methods or blocks. Non-synchronized methods can be executed freely.
Correct Answer: b) Yes, because they acquire different locks
Explanation:
Instance synchronized methods acquire the object instance lock, while static synchronized methods acquire the Class object lock. They do not block each other.
Correct Answer: d) ScheduledThreadPool
Explanation:
Executors.newScheduledThreadPool() returns a ScheduledExecutorService specifically designed for delayed or periodic task execution.
Correct Answer: b) Using shutdown(), the waiting tasks are executed before the pool terminates completely
Explanation:
shutdown() allows both currently running tasks and tasks queued up to execute. Only new task submissions are rejected.
Related Posts

JavaScript Interview Questions MCQs
JavaScript interview questions evaluate a developer’s deep understanding of core language mechanics, execution models, and advanced runtime behavior. Top tech…
August 29, 2026By MCQs Generator

Java Control Flow / If Else MCQs
Control flow statements in Java determine the exact order in which code instructions and expressions execute during runtime. By default,…
October 19, 2026By MCQs Generator

Latest Java Loops MCQs
Iteration structures in Java allow developers to execute code blocks repeatedly based on dynamic boolean conditions, eliminating code duplication and…
October 19, 2026By MCQs Generator
Related Categories

AI & Data Science MCQ
5 topics
By MCQs Generator

Arts & Humanities MCQ
4 topics
By MCQs Generator

Civil Engineering MCQ
4 topics
By MCQs Generator

Commerce & Business MCQ
4 topics
By MCQs Generator

Competitive Exams MCQ
5 topics
By MCQs Generator

Electrical & Electronics Engineering MCQ
3 topics
By MCQs Generator

General Knowledge MCQ
2 topics
By MCQs Generator

General Science MCQ
4 topics
By MCQs Generator

Law & Judiciary MCQ
3 topics
By MCQs Generator

Mechanical Engineering MCQ
4 topics
By MCQs Generator

Medical & Health Sciences MCQ
4 topics
By MCQs Generator

Modern Tech Fields MCQ
3 topics
By MCQs Generator