Only subclass has implemented Serializable interface.
import java.io.*;
public class NewClass1{
private int i;
NewCla
I've not tested it, but you shall get a NotSerializableException if serializing the instance of base class. It is the same when your class contains some members that are not Serializable.
Means if you create an object NewClass1 nc1 = new NewClass1(); and try to serialize the obj nc1, you will get the exception that you want.