ClassEntry must override and implement Object.equals(Object o) to remove to work. For instance:
class ClassEntry{ float a; int b; public ClassEntry(float a, int b){
EDIT: As @Jim Garrison noted, if you do not implement equal default values, i.e. compare objects by reference, is used. In this case, for your code to work, you will need to delete it like this:
PriorityQueue[] P = new PriorityQueue[10]; P[1] = new PriorityQueue<ClassEntry>(); ClassEntry entry = new ClassEntry(10,4); P[1].add(entry);
source share