class ThreadTest
{
public static void main(String[] args)
{
Test t = new Test() ;
TestRunnable tr = new TestRunnable();
Thread t1 = new Thread(tr) ;
t.start() ;
}
}
class Test extends Thread
{
public void run()
{
System.out.println("subThread run");
}
}
class TestRunnable implements Runnable
{
public void run()
{
System.out.println("runable run");
}
}
你那个代码不还原成不是匿名内部类,就是这样子的。自己研究下吧 |