Java Interview Question

What is multithreading in Java?

Updated 2026-07-10 · Beginner friendly
Quick answer

Multithreading is running several threads at the same time within one program, where each thread is an independent path of execution. It lets an application do multiple things at once, such as downloading a file while keeping the interface responsive. In Java you create threads by extending Thread or implementing Runnable.

Why use threads

A single threaded program does one thing at a time. Threads let you use multiple CPU cores and keep an app responsive, for example handling many web requests together on a server.

Runnable task = () -> System.out.println("running on a thread");
Thread t = new Thread(task);
t.start();   // runs task on a new thread

The main challenge

When threads share data, they can interfere with each other, causing race conditions. Java offers tools like synchronized blocks, locks, and concurrent collections to coordinate access safely.

In the interview

Expect a follow up on thread safety. Mention race conditions and that you protect shared state with synchronized, locks, or thread safe classes like ConcurrentHashMap. Awareness of the risks matters more than memorising the API.

Want the full Java guide?

Read every Java concept with notes, diagrams, and code in one place. Track your progress as you go.

Open the Java guide All Java questions