A default constructor thread object allocates a new 2 this constructor and above #Thread (ThreadGroup, Runnable, String) method has the same effect, wherein the thread name is the name of a newly generated 3 automatically generated name is formatted as the Thread- n-, wherein n is an integer . 4 / ** . 5 * a new new Allocates { @code the Thread Object}. The Same has This constructor . 6 * Effect AS { @linkplain #Thread (of ThreadGroup, the Runnable, String)} the Thread . 7 * { @code ( null, null, gname)}, {WHERE @code gname} IS A newly Generated . 8 * name. The the Automatically Generated names are of form . 9 * { @code "Thread-"+}<i>n</i>, where <i>n</i> is an integer. 10 */ 11 public Thread() { 12 init(null, null, "Thread-" + nextThreadNum(), 0); 13 }
Output test code space
. 1 the Thread name = new new the Thread (); 2 name.run ();