I want to make a class that accepts everything ordered and prints more. (I was just studying, so I know it's a little useless)
class PrinterOfGreater[T extends Ordered](val a:T, val b:T){println(a > b)}
I know that it cannot be written with this style in scala, but I don’t know how to write it ... Does anyone know?
and why doesn't it compile? Serum line wrapper ordered
class PrinterOfGreater[T <: Ordered[T]](a:T, b:T){println(a > b)} object A extends Application{new PrinterOfGreater("abc","abd")}
source share