这是一个关于线程的代码,他说while(ture)有错误,我百思不得其解,请各位高手解决
class ThreadDemo
{
public static void main (String[] args)
{
new Thread().start();
new TestThread().start();
while(ture)
{
System.out.println("main():"+Thread.currentThread().getName());
}
}
}class TestThread extends Thread
{
public void run()
{
while(ture)
{
System.out.println("run():"+Thread.currentThread().getName());
}
}
}
class ThreadDemo
{
public static void main (String[] args)
{
new Thread().start();
new TestThread().start();
while(ture)
{
System.out.println("main():"+Thread.currentThread().getName());
}
}
}class TestThread extends Thread
{
public void run()
{
while(ture)
{
System.out.println("run():"+Thread.currentThread().getName());
}
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货