← Questions

Runnable versus Callable and a thread-safe singleton

0
AppleCodingLast asked Jan 2026

Java concurrency questions: explain the difference between Runnable and Callable (return value, checked exceptions, how each is run through an executor and Future), then write a singleton that is safe when several threads first ask for it at once, and explain why it is safe (eager init, synchronized access, double-checked locking with volatile, or a holder class).

Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding