Thread constructors and names
There are four basic constructors; their arguments can be:
- A name (String) for the Thread (default null).
- Should be unique, used for debugging etc.
- An object (Runnable) to call a run() method in.
class ThreadExample implements Runnable {
Thread t1 = new Thread();
Thread t2 = new Thread("sun");
Thread t3 = new Thread(this);
Thread t4 = new Thread(this, "t4");