I want to make a simulation of a queueing system in Java.
public void enqueue(Packet...packets)
{
// here the Packet object needs to be added to an existing ArrayList..
}
I tried to add the Packet as follows in my existing Arraylist queue
queue.add(packets)
but this doesn't work.
How can I best do this ? I can't give an ArrayList
as argument, it has to be Packet...packets
.