yield()的用法class A{public static void main(String[] args){ B mt=new B();mt.setDaemon(true);mt.start();int index=1;while(true){ if(index

来源:学生作业学帮网 编辑:学帮网 时间:2024/06/09 03:47:33

yield()的用法
class A
{
public static void main(String[] args)
{
B mt=new B();
mt.setDaemon(true);
mt.start();
int index=1;
while(true)
{
if(index

unreachable statement意思就是执行不到,上面的while是死循环,当然执行不到yield();了