class ThreadDemo4
{
public static void main(String[] args)
{
Sale t = new Sale();
Thread t1 = new Thread(t);//创建一个线程
Thread t2 = new Thread(t);//创建一个线程
t1.start();
try{Thread.sleep(10);}catch(Exception e){}//关闭主线程,运行t1
t.flog = false;//开启线程一,即关闭if,让线程二执行else中语句
t2.start();
}
}