谁能帮我看看这个程序的运行结果

class A implements Runnable
{
int i = 0;
public synchronized void out()
{
while(true)
{
System.out.printf("haha");
try
{
Thread.sleep(1000);
}
catch(Exception e)
{

        }

    }
}
public synchronized void run()
{
    while(true)
    {
        try
        {
            Thread.sleep(100);
        }
        catch(Exception e)
        {

        }
        System.out.printf("%d",i++);
    }
}   

}
class test3
{
public static void main(String [] args)
{
A aa1 = new A();
Thread t1 = new Thread(aa1);
t1.start();
t1.setPriority(Thread.NORM_PRIORITY - 4);
aa1.out();

}   

}

查看全部
qq_28000789
qq_28000789
2015/06/04 09:08
  • java
  • 点赞
  • 收藏
  • 回答
    私信

6个回复