java.lang.ClassCastException: NameRank cannot be cast to java.lang.String

Coderanch | Nathan Doe | 7 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    Implementing Comparable Interface with TreeSets

    Coderanch | 7 years ago | Nathan Doe
    java.lang.ClassCastException: NameRank cannot be cast to java.lang.String

    Root Cause Analysis

    1. java.lang.ClassCastException

      NameRank cannot be cast to java.lang.String

      at NameRank.compareTo()
    2. Unknown
      NameRank.compareTo
      1. NameRank.compareTo(NameRank.java:1)
      1 frame
    3. Java RT
      TreeSet.add
      1. java.util.TreeMap.put(TreeMap.java:545)
      2. java.util.TreeSet.add(TreeSet.java:238)
      2 frames
    4. Unknown
      CollectionsTest.main
      1. CollectionsTest.main(CollectionsTest.java:213)
      1 frame