What does the volatile keyword guarantee in Java multithreading?
What is the output of the following code?
volatile int counter = 0;
counter++; // in multiple threads
Which issue may occur?
What is CyclicBarrier used for in multithreading?
Which of the following is true about CountDownLatch?
What is the purpose of the wait() method in Java?
Advertisement
In a synchronized block, if notifyAll() is called, what happens?
What is the primary difference between Semaphore and Mutex?
What happens when Thread.interrupt() is called on a thread?
Consider a scenario: Thread A is waiting in wait() inside a synchronized block. Thread B calls notify(). What is the state of Thread A?
In a deadlock scenario, which of the following is always true?
Which of the following collections is thread-safe in Java?
What is the key difference between Callable and Runnable?
In a high-concurrency scenario using Java 21, which approach is recommended for I/O-bound operations?
What is the purpose of the strictfp modifier in the context of multithreading?
In a producer-consumer problem, what is the ideal synchronization mechanism?
What is the output of the following code?
Thread t = new Thread(() -> System.out.println(Thread.currentThread().getName()));
t.start();
Which method must be implemented to create a thread in Java?
What is the difference between start() and run() methods in threading?
Which of the following thread states is NOT a valid Java thread state?
What will happen if you try to call start() on a thread that has already completed execution?