#string not comparable?

1 messages · Page 1 of 1 (latest)

granite tapir
#

i have a generic method in a parent class that takes a parameter type of comparable<T>. when i try to use that method in a subclass by passing in a string, it doesnt work. i get incompatible type cannot convert to comparable<t>. why is this? i thought strings automatically implement comparable interface

rough dirgeBOT
#

This post has been reserved for your question.

Hey @granite tapir! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.