I am implementing a priority queue of 5 processes.Each process has identical fields with different values. I have 3 classes. One is a template for the process, a second one for the actual algorithm that I will be implementing regarding those processes and one Test. I am trying to print out all the arrive\_time attributes of the processes in my priority queue. Those fields are all integers, but the actual processes are of type Process, which crashes the PriorityQueue class. I need help here.

first class:

```
package SPN;

public class Process {

    public int arrive_time= 0;
    private int burst_time = 0;
    private int remain_time = 0;

    public Process (int arr_time, int bur_time) {

        this.arrive_time = arr_time;
        this.burst_time = bur_time;
    }

    //public int getArrTime() {return arrive_time;}
    public int getBurTime() {return burst_time;}
    public int getRemTime() {return remain_time;}
}

```

second class:

```
package SPN;

import java.util.*;

public class SPN {

    private Process p1, p2, p3, p4, p5;

    //Priority Queue of the processes
    PriorityQueue<Process> prq = new PriorityQueue<Process>();

    public SPN() {

        p1 = new Process(0, 10);
        prq.add(p1);

        p2 = new Process(1, 8);
        prq.add(p2);

        p3 = new Process(2, 11);
        prq.add(p3);

        p4 = new Process(5, 6);
        prq.add(p4);

        p5 = new Process(7, 7);
        prq.add(p5);
    }

    public void test() {

        // create iterator from the queue
        Iterator<Process> it = prq.iterator();

        System.out.println("Values of queue: " + it.next());
    }
}

```

third class:

```
package SPN;

public class Test {

    public static void main(String[] args) {

        SPN spn = new SPN();
        spn.test();
    }
}

```