PDA

View Full Version : What is the use of RUNNABLE interface in java?



MVM Infotech
10-17-2018, 11:32 AM
What is the use of RUNNABLE interface in java?

Servers Base
04-25-2019, 06:45 PM
Runnable interface is a type of functional interface which is designed to provide a common protocol for objects that wish to execute code while they are active.

ORLOVA
09-06-2019, 06:48 AM
Runnable is an interface designed to encapsulate some independent unit of work that can run and do something useful and isn’t specifically expected to return a value at the end.

sinelogixtech
09-06-2019, 10:52 AM
Hi Friends,
Runnable interface is a type of functional interface which is designed to provide a common protocol for objects that wish to execute code while they are active.

The Runnable interface should be implemented by any class whose instances are intended to be executed by a thread. The class must define a method run. It is used to create thread.

public void run(): is used to perform action for a thread.

RH-Calvin
09-09-2019, 06:57 AM
Runnable interface is a type of functional interface which is designed to provide a common protocol for objects that wish to execute code while they are active. The Runnable interface should be implemented by any class whose instances are intended to be executed by a thread.

lishmalinyjames
01-23-2021, 02:24 PM
The Runnable interface should be implemented by any class whose instances are intended to be executed by a thread. The class must define a method of no arguments called run. This interface is designed to provide a common protocol for objects that wish to execute code while they are active.

jayright2020
01-25-2021, 05:38 AM
Java runnable is an interface used to execute code on a concurrent thread. It is an interface which is implemented by any class if we want that the instances of that class should be executed by a thread. This method takes in no arguments.

lishmalinyjames
05-13-2021, 02:54 PM
Java runnable is an interface used to execute code on a concurrent thread. It is an interface that is implemented by any class if we want that the instances of that class should be executed by a thread. This method takes in no arguments.

Akshay_M
08-03-2022, 01:41 PM
Interface Runnable
The Runnable interface should be implemented by any class whose instances are intended to be executed by a thread. The class must define a method of no arguments called run . This interface is designed to provide a common protocol for objects that wish to execute code while they are active.

Agent39
04-23-2024, 03:57 PM
Runnable interface in Java is used to make a class instance run as a thread by implementing it. It is mainly used in multi-threaded programming where we want to execute the same class instance using multiple threads

tarhibniamul
05-09-2024, 05:20 AM
The Runnable interface in Java is used to define a task that can be executed concurrently by a thread. It provides a way to create threads without subclassing the Thread class. By implementing the Runnable interface and overriding its run() method, you can define the code that the thread will execute when started. This allows for better separation of concerns and promotes a more modular and flexible design in concurrent programming.