I have read Constructor Calls while serialization , Serialization Rules but can't able to find out all rule for member variable.
I have below question:
Student.java
class Person {
}
class Student extends Person implements Serialization {
List<Book> books;
Student(){}
Student(List<Book> books) {
this.books = books;
}
}
class Book implements Serialization {
Book() {}
String bookId;
Book(String bookId) {
this.bookId = bookId;
}
}
Here Student is serializable and Book class is also serializable then what are rules for constructor calling serializable and deserializable.
- Is required default constructor in Book class? If Yes , Then Why required default constructor while deserialization.
- How constructor calls while serialization and deserialization?