java thread basic

class MyThreadA extends Thread

Thread t2=new MyThreadB();

t2.setDaemon(true);

t1.start();//t1.run();

Thread.sleep(1000);

class MyRunnableA implements Runnable

Thread t1=new Thread(new MyRunnableA());


你可能感兴趣的:(java,thread,basic)