..A thread is an independent path of execution within a program. Many threads can run concurrently within a program. Every thread in Java is created and controlled by the java.lang.Thread class.
..The first way is to extend the Thread class, override the run() method with the code you want to execute, then create a new object from your class and call start(). The second method is to pass an implementation of the Runnable interface to the constructor of Thread, then call start().
.. Implementing Runnable Interface.
No comments:
Post a Comment