Ctrl K
Java · Junior · Theory

What are the ways to create a thread in Java, and what's the difference between calling start() and run()?

~4 min by voice

How to approach it

The interviewer checks basic understanding of multithreading in Java: whether the candidate knows the ways to define a task for a thread and understands that only start() actually creates a new thread, while run() is a regular method.

Have you seen this question in a real interview?
Answers0
Avg. score—
Strong—
Practiced0
Topics
Similar questionsНесколько потоков одновременно делают counter++ над общей переменной, и в итоге значение получается меньше ожидаемого. Объясните, что именно происходит на уровне процессора и памяти, и какими способами это можно исправить — чем они отличаются внутри. Mid-levelWhat is a race condition, and what tools does Java give you to protect against it? JuniorWhy do we need thread pools, and how do you work with ExecutorService? Junior

Answer by voice

The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.

Sign in to answer

Best with headphones · ~4 min