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();
}
}