
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference Between Thread Class and Runnable Interface in Java
In this post, we will understand the difference between
Thread
It is a class.
It can be used to create a thread.
It has multiple methods such as ‘start’ and ‘run’.
It requires more memory space.
Since multiple inheritance is not allowed in Java, hence, after a class extends the Thread class, it can’t extend to any other class.
Every thread creates a unique object and associates with it.
Runnable
It is a functional interface.
It can be used to create a thread.
It has a single abstract method ‘run’.
It requires less memory space.
When a class implements the ‘runnable’ interface, the class can extend to other classes.
Multiple threads can share the same objects.
- Related Questions & Answers
- Difference between Thread and Runnable in Java
- Difference between Runnable and Callable interface in java
- Difference Between Class and Interface in Java
- Difference between Abstract Class and Interface in Java
- Difference between abstract class and interface
- How to create a thread without implementing the Runnable interface in Java?
- What is Runnable interface in Java?
- Difference Between Interface and Abstract Class in Java & C#
- Implement Runnable vs Extend Thread in Java
- Difference between Abstract Class and Interface in C#
- Differences between Interface and class in Java
- Difference Between Process and Thread in Java
- Difference between Abstract Class and Interface in C# Program
- Differences between abstract class and interface in Java
- Difference between Process and Thread
Advertisements