Im pretty new to java, i have a program i am working on that requires my defined queue be sorted based upon a certian component of the class it represents.
Queue<apples> applesqueue; applesqueue = new LinkedList<apples>(); public apples{ public int getnumber(){ return number }
This is just a quick example i made up, now say if i wanted to sort my queue based on the getnumber method, how would i go about doing so?
Thanks in advance