How would you serialize this class? public class User {}
public class User {}
Declare the class as public serializable class User {}.
public serializable class User {}
Mark the User class with the DeserializableAttribute.
DeserializableAttribute
Declare the class as private serializable class User {}. Official documentation: SerializableAttribute Class
private serializable class User {}
Mark the User class with the SerializableAttribute attribute.
SerializableAttribute