Skip to content
Sharp

Java Threading · interview question

What happens if you call shutdownNow() on an ExecutorService?

Multiple choiceMediumchapter-15-curatedpremiumjava-threadingexecutorservice
Choose one answer
Answer and explanation

Correct answer

A. It attempts to stop all actively executing tasks.

Why

shutdownNow() attempts to stop all actively executing tasks, halts the processing of waiting tasks, and returns a list of the tasks that were awaiting execution.

Test yourself on Java Threading

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

Start free test
All Java Threading questions →