Skip to content
Sharp

Concurrency basics · interview question

Which ExecutorService method stops accepting new tasks but lets already-submitted tasks finish? (method name)

Fill in the blankMedium
Answer and explanation

Correct answer

shutdown or shutdown() or executor.shutdown()

Why

shutdown() is graceful; follow it with awaitTermination(...). shutdownNow() attempts to stop running tasks by interrupting them and returns the tasks that never started.

Test yourself on Concurrency basics

A free test with instant, explained results. No account needed.

Start free test
All Concurrency basics questions →