This content has been marked as final. Show 2 replies
The API docs can tell you why that's happening. From the doc for the add method of the TreeSet class:
ClassCastException - if the specified object cannot be compared with the elements currently in the set.
either make SymbolTableEntry implement the Comparable interface, or create your TreeSet with a custom Comparator that establishes an ordering for SymbolTableEntry objects.