Why should a Comparator implement Serializable?

前端 未结 5 536
陌清茗
陌清茗 2021-02-02 06:46

New to Java. Learning it while working on an Android app. I am implementing a Comparator to sort a list of files and the android docs say that a Comparator should implement Seri

5条回答
  •  [愿得一人]
    2021-02-02 07:25

    i have seen in Java 5 API Link to java 5 APT which stated that by implementing Comparator doesn't mean to implement Serializable interface anyways, so one has to explicitly pay attention to get Serializable in some customarily created Comparator class

提交回复
热议问题