Top 100+ Java Multithreading Interview Questions and Answers - 2

Question: 6

What state is a thread in when it is executing?

An executing thread is in the running state.

Question: 7

What is the difference between yielding and sleeping?

When a task invokes its yield() method, it returns to the ready state.

When a task invokes its sleep() method, it returns to the waiting state.

Question: 8

Can a method be static and synchronized?

No a static method can’t be synchronized.

Question: 9

How can multiple threads be controlled simultaneously?

If you create threads in a ThreadGroup object, they may be controlled simultaneously with the member function of said object.

Question: 10

What’s new with the stop(), suspend() and resume() method?

The stop(), suspend() and resume() methods have been deprecated in JDK 1.2.

Related Questions