Lecture 4 Flashcards
What is threading
Threading is a programming concept that allows a program or application to execute multiple threads (smaller units of a process) concurrently, enabling better resource utilization and improved performance.
Describe Runnable interface
The Runnable interface is a fundamental part of multithreading in Java.
It represents a task or unit of work that can be executed concurrently by a thread.
used in conjunction with the Thread class to create and start new threads.
Benefits of runnable interface
Using the Runnable interface allows for more flexibility in creating and managing threads
It’s especially useful when you want to reuse the same task in multiple threads or when you’re working in a multi-threaded environment.