Java Serializable: Must E be serializable in ArrayList<E>?

Viewed 106

I have the following class containing the fields specified below. My question is, must Admin, Worker and all my other self-defined classes implement Serializable for MyClass to be Serializable?

public class MyClass implements java.io.Serializable {
  private static final long serialVersionUID = 1L;
  ArrayList<Admin> admins;
  ArrayList<Worker> workers;
  ArrayList<Manager> managers;
  ArrayList<Secretary> secretaries;
  ArrayList<Category> categories;
  HashMap<Issue, HashMap<Category,Manager>> ManagedIssues;
  private static MyClass instance;
      ...
}
5 Answers
Related