Académique Documents
Professionnel Documents
Culture Documents
Multithreading in Java
: Thread Class and Runnable
Interface
Java’s multithreading system is built upon
the Thread class, its methods, and its
companion interface,Runnable. To create
a new thread, your program will either
extend Thread or implement the Runna
bleinterface.
Runnable Interface
Example:
1public class MyClass implements Runnable {
2public void run(){
3System.out.println("MyClass running");
4 }
}
5
PREVIOUS
NEXT
Related Posts
Java Collections – Interface, List, Queue, Sets in Java
With Examples
14.1K
Comments
0 Comments
Related Blogs