What is Runnable?

Java MCQ: What is Runnable?

a) An interface
b) A class
c) A method
d) A package

Answer:

a) An interface

Explanation:

The Runnable interface in Java is used to define a task that can be executed by a thread. It has a single method, run(), that must be implemented by any class that implements the interface.

Reference links:

https://www.rameshfadatare.com/learn-java-programming/
https://www.javaguides.net/p/java-tutorial-learn-java-programming.html

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top