In Java 2024-25, which enhancement improved record support in collections?
Which method in Collections can create a thread-safe Map from a non-thread-safe Map?
What is the main advantage of EnumSet over HashSet when working with Enum constants?
Consider this code: List<String> list = new CopyOnWriteArrayList<>(); list.add("A"); list.add("B"); Iterator<String> itr = list.iterator(); list.add("C"); System.out.println(itr.next());
In Java 2024, if you need a collection that automatically removes entries based on garbage collection patterns, which would you choose?
Advertisement
What happens when wait() is called from a thread that doesn't hold the lock?
How does the volatile keyword help in multithreading?
What will happen if you call sleep() inside a synchronized block?
Which interface allows multiple threads to access a resource with a permit system?
Consider code where Thread A holds Lock1 and waits for Lock2, while Thread B holds Lock2 and waits for Lock1. What is this scenario called?
Consider the following code. What will be the likely behavior?
java
synchronized void method1() { method2(); }
synchronized void method2() { }
Which class is used to synchronize the execution of multiple threads at a specific point?
What is the difference between CountDownLatch and CyclicBarrier?
What will happen if a thread tries to acquire a lock it already holds while inside a synchronized method?
In a high-concurrency scenario with 2024-25 exam patterns, which Java construct provides the best lock-free approach for thread safety?
What is the primary advantage of using ReentrantLock over synchronized?
In a high-traffic web application using Java 21 Virtual Threads, what is the main performance benefit?
Which pattern should be used to safely publish data from one thread to another?
What is the purpose of ForkJoinPool in Java?
If a thread is blocked waiting for I/O, what happens when interrupt() is called on it?