java.lang.ClassCastException

java.lang.StringBuilder cannot be cast to java.lang.Comparable

Solutions on the web19029

  • via ideone.com by Unknown author, 11 months ago
    java.lang.StringBuilder cannot be cast to java.lang.Comparable
  • via ideone.com by Unknown author, 11 months ago
    java.lang.StringBuilder cannot be cast to java.lang.Comparable
  • TestClass cannot be cast to java.lang.StringBuilder
  • Stack trace

    • java.lang.ClassCastException: java.lang.StringBuilder cannot be cast to java.lang.Comparable at java.util.Collections$ReverseComparator.compare(Collections.java:5108) at java.util.TimSort.countRunAndMakeAscending(TimSort.java:351) at java.util.TimSort.sort(TimSort.java:216) at java.util.Arrays.sort(Arrays.java:1512) at java.util.ArrayList.sort(ArrayList.java:1454) at java.util.Collections.sort(Collections.java:175) at WhatISThis.main(Main.java:15)

    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 user
    Once, 10 months ago
    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 2 years ago