public class Demo0400
{
public static void main(String[] args)
{
Text0400 t = new Text0400();
Thread th1 = new Thread(t, "1111");
Thread th2 = new Thread(t, "2222");
th1.start();
th2.start();
}
};
class Text0400 implements Runnable
{
private int tick = 100;
Object obj = new Object();
public void run()
{
while (true)// 求这行代码的作用 ?
{
synchronized (obj) //为什么需要上面加个while (true) ;