Java: How to make this Serializable?

前端 未结 3 534
误落风尘
误落风尘 2021-01-18 19:31

I need the following class to be Serializable.

package helpers;

public class XY implements Comparable
{
    public int x;
    public int y;

    p         


        
3条回答
  •  没有蜡笔的小新
    2021-01-18 19:54

    Please see the SerializationUtils API provided by Apache Commons Lang.

    This is much safer and more maintenance friendly. :)

提交回复
热议问题