Hello, I want to do a class thats accepts anything ordered and prints greater. (I'm just learning so I know it's a bit useless)
class PrinterOfGreater[T extends Ordered](val a:T, val b:T){println(a > b)}
I know that it can't be written by this style in scala, but I don't know how to write it properly... Do anybody know?
and why this doesn't compile? Whey the string wrapper is Ordered
class PrinterOfGreater[T <: Ordered[T]](a:T, b:T){println(a > b)}
object A extends Application{new PrinterOfGreater("abc","abd")}