为什么 trait Ordering 需要实现 Serializable?

时间:2021-05-12 02:09:50

标签: scala

https://www.scala-lang.org/api/current/scala/math/Ordering.html

trait Ordering[T] extends Comparator[T] with PartialOrdering[T] with Serializable

为什么 trait Ordering 需要实现 Serializable?我认为没有需要将 Ordering 的实例保存在文件中或通过网络传输的情况。如果有这个要求,似乎不是 Ordering 的责任来处理它< /p>

谢谢!

0 个答案:

没有答案