public class MultiThread implements Runnable {private String threadName = ""; public static void main (String [] args) {MultiThread multiThread = new MultiThread (); multiThread.setName ( "TestThread"); new Thread (multiThread) .start () ;
For (int i = 0; i <10; i ) {new thread (new multithread ()). start (); // correct // new thread (new multithread ()). run (); // error // New multithread (). Run (); // error} system.out.println ("ok"); char NO1 = '1'; char NO2 = (char) (NO1 19); System.out.Println (NO1 ); System.out.println (no2);} public void run () {Try {thread.sleep (1000);} catch (interruptedException e) {} system.out.println (threadname ": thread.currentthread () .Getname ());} public void setname (string threadname) {this.threadname = threadname;}}