i have a class call Job which define (jobNumber,executionTIme,priorityLevel) (eg. for constructor Job) im going to use it for priorityQueue which is imported and used in other class call JobLine.
I have a method call compareTo() in Job class to compare the priority between Job object.
how should implements or extends Comparable to Job constructor so that PriorityQueue know which to compare the priority.
help is appreciated.
By what you have written, you can simply implement (be aware, you can implement an interface but not extend it) it as this:
See this question to understand how to correctly implement the interface.
However, you can use some more “advanced” algorithms considering execution time, and job number, but you have to explain what you want if that’s the case.
I didn’t understand what you mean by “extend it to the constructor” in the question