class MyThread extends Thread
{ public static void main(String args[])
{
Thread t=Thread.currentThread();
System.out.println("主线程是: "+t);
MyThread ex=new MyThread();
ex.start();
}
public void run()
{
System.out.println("子线程是: "+ this);
}
}这个代码是没什么实现,这样有什么好处呢?
{ public static void main(String args[])
{
Thread t=Thread.currentThread();
System.out.println("主线程是: "+t);
MyThread ex=new MyThread();
ex.start();
}
public void run()
{
System.out.println("子线程是: "+ this);
}
}这个代码是没什么实现,这样有什么好处呢?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货