{
try
{
System.out.println(”Consumer name:“+strConsumer+” “);
Thread.sleep(nTime);
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
static public void main(String args[])
{
Consumer aConsumer = new Consumer (1000, ”aConsumer“);
aConsumer.start();
Consumer bConsumer = new Consumer (2000, ”bConsumer“);
bConsumer.start();
Consumer cConsumer = new Consumer (3000, ”cConsumer “);
cConsumer.start();
}
}
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/