Practice.Obj cannot be cast to java.lang.Comparable

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web26

  • via Unknown by Lio Liov,
  • via Stack Overflow by MatlabSorter
  • Stack trace

    • java.lang.ClassCastException: Practice.Obj cannot be cast to java.lang.Comparable at java.util.PriorityQueue.siftUpComparable(Unknown Source) at java.util.PriorityQueue.siftUp(Unknown Source) at java.util.PriorityQueue.offer(Unknown Source) at java.util.PriorityQueue.add(Unknown Source) at Practice.QueueExample.main(

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown visitor
    Unknown visitorOnce,