When I run below program, I am getting exception as
java.io.InvalidClassException: Files.SerializationMain; Files.SerializationMain; no valid constructor
Just provide default constructor in both classes (Parent & Child)
During deserialization, the fields of non-serializable classes will be initialized using the public or protected no-arg constructor of the class. A no-arg constructor must be accessible to the subclass that is serializable. The fields of serializable subclasses will be restored from the stream. more