There are two ways to use thread class.
One is directly used in the function.
The Runnable class is the job to do.
new Thread(new Runnable() { @Override public void run() { //Do things. } }).start();
Another is create a new class and extend the thread interface.
public class MyThread extends Thread { public void run() { //Do things. } }
No comments:
Post a Comment