Why does my PriorityBlockingQueue in Java not sort properly?
问题 For some reason when I add to the priority queue, it doesn't sort my strings entirely alphabetically and I can't see why. This is the code which adds to the PriorityBlockingQueue: String toAdd = String.format("%s/%s", directory, s); outputData.add(toAdd); But I get not entirely sorted output (only first few lines but you can see it's not sorted): ../StartingTree/files/abknl/apfmpohgyh/a.class ../StartingTree/files/abknl/apfmpohgyh/a.java ../StartingTree/files/abknl/aqybc/aeph.java ..