class test implements Runnable
{
@Override
public void run() {
System.out.println(Thread.currentThread());//在这里这2个对象不一样,Thread.currentThread()表示是Thread的对象。this则是表示test类的对象
System.out.println(this);
}
}
class wu
{
public static void main(String [] args)
{
test t1 = new test();
Thread th = new Thread(t1,"张三");
th.start();
}
}