java.lang.ClassCastException: java.util.HashSet cannot be cast to java.lang.Comparable

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Stack Overflow by Tai
, 1 year ago
java.util.HashSet cannot be cast to java.lang.Comparable
via y3x.ru by Unknown author, 1 year ago
Box cannot be cast to java.lang.Comparable
via Stack Overflow by sbala_20
, 2 years ago
com.java.split.Node cannot be cast to java.lang.Comparable
via Stack Overflow by manos
, 2 years ago
exercise.pkg4.patienthuman cannot be cast to java.lang.Comparable
via Stack Overflow by MatlabSorter
, 1 year ago
[Ljava.lang.Object; cannot be cast to java.lang.Comparable
java.lang.ClassCastException: java.util.HashSet cannot be cast to java.lang.Comparable
at java.util.PriorityQueue.siftUpComparable(PriorityQueue.java:652)
at java.util.PriorityQueue.siftUp(PriorityQueue.java:647)
at java.util.PriorityQueue.offer(PriorityQueue.java:344)
at java.util.PriorityQueue.add(PriorityQueue.java:321)
at attempt1.PQTest.main(PQTest.java:11)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 2 years ago

Know the solutions? Share your knowledge to help other developers to debug faster.