Java Multithreading вопросы и ответы для интервью
Question: Explain the difference between Thread and Runnable.Answer: Thread is a class in Java that provides methods to create and perform operations on a thread. Runnable is an interface that must be implemented by a class to be executed by a thread.Example:
|
Сохранить для повторения
Добавьте этот элемент в закладки, отметьте как сложный или поместите в набор для повторения.
Войдите, чтобы сохранять закладки, сложные вопросы и наборы для повторения.
Это полезно? Да Нет
Самое полезное по оценкам пользователей:
- What is multithreading?
- What is the purpose of the yield() method?
- What is the purpose of the sleep() method in Java?
- How do you create a thread in Java?
- Explain the difference between Thread and Runnable.