8 Ağustos 2023 Salı

JEP 359 record ve Serialization

Örnek
Şöyle yaparız
record Range(int low, int high) implements Serializable {
private Object readResolve() { if (high < low) { throw new IllegalStateException("Serialized object has high value less than low value"); } return this; } }

Hiç yorum yok:

Yorum Gönder