SE450: Consumer Thread [19/36] Previous pageContentsNext page

int i = 1; 
while (i <= greetingCount)
{
if (!queue.isEmpty())
{
Object greeting = queue.remove();
System.out.println(greeting);
i++;
}
Thread.sleep((int)(Math.random() * DELAY));
}

Previous pageContentsNext page