Hello, I am trying to learn about queues and am a bit stuck and dont really know if this is working or not.
What I want to do is to add a object of Processes labled p1 p2 p3 ect.... which has the characteristics like this
public int priority; //not to exceed 4
public int arrivalTime;
public int finishTime;
this is one class with some get and set methods and what not they all work fine.
This is my comparator that I made
And this looks like it should work well but not 100% on this I just following some stuff I found online for this.
and here is where i put them in the queue and print them off
I dont know if this is working becuase it gives me a
"Exception in
thread "main" java.util.ConcurrentModificationException"
when it hits the foreach loop when I am trying to print this off.
also how can i print off something more meaningful than Process@1fb8ee3 I really dont know how to get useful information out of the queue.
Thank you for any help with this.