Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Java Multithreading Interview Questions and Answers

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:

class MyRunnable implements Runnable { 
public void run() 
{ /* Runnable logic */
 } 
}
Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook