What is Wrong! Re: Implementing FcFs queue with J2SE 5.0



I found a following snippet in Web but it gives warnings.
This should the PriorityQueue I need but there is something wrong....

PriorityQueue <Priority> priorityQueue = new PriorityQueue(10,
new Comparator<Priority>()
{
public int compare(Priority a, Priority b)
{
System.out.println("Comparing Populations");
int populationA = a.getPopulation();
int populationB = b.getPopulation();
if (populationB > populationA)
return 1;
else if (populationB < populationA)
return -1;
else
return 0;
}
}
);
}


"Veikka" <veikka@xxxxxxxxxx> wrote in message
news:dp3rsp$gti$1@xxxxxxxxxxxxxxxxxxxxx
> Hello,
>
> J2SE 5.0 has a lot's of new classes considering multithreading.
> What is the best class to implement queue in FirstComesFirstServed model?
>
> Any sample code arapund?
>
> Cheers!
>
>


.