Answer the question
In order to leave comments, you need to log in
How to serialize a class with a nested object of another class?
I want to store an object of this class
public class District implements Serializable {
private static final long serialVersionUID = 1L;
private String name;
private int age;
private Quarter quarter;
public District(String name, int age, Quarter quarter) {
this.name = name;
this.age = age;
}
}
Answer the question
In order to leave comments, you need to log in
In general, there was some kind of bug IDE rebooted and everything worked
IMHO now serialization of objects is done via JSON. :-)
For example gson is a convenient library for working with JSON.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question