When I have Serializable
in a class, do I need to add Serializable
to all my objects within the class?
For example,
public class User implements Serializable{
private List<Role> role;
private Task task;
}
Do I need to add Serializable
to Role
and Task
, too?
public class Task implements Serializable{
// ...
}
public class Role implements Serializable{
// ...
}