/*
需求:简单的卖票程序
多个窗口同时卖票
*/
class Ticket extends Thread
{
private int tick=100;
public void run()
{
while(ture)
{
if(tick>0)
{
System.out.println(currentTread().getName()+"......sale:"+tick--);
}
}
}
}
class TicketDemo
{
public static void main(String[] args)
{
ticket t1=new ticket();
ticket t2=new ticket();
ticket t3=new ticket();
ticket t4=new ticket();
t1.start();
t2.start();
t3.start();
t4.start();
//System.out.println("Hello World!");
}
}
提问:循环中while(true)中的true代表什么?
|
|