Skip to main content

Creating Objects Without Calling Constructors

Java Champion Dr. Heinz M. Kabutz talks about "Creating Objects Without Calling Constructors":

A few months before disappearing amongst the sand dunes of Chania's beaches on my extended summer vacation, I was explaining to the students on my advanced Java course how deserialization worked. If the object is serializable, then it is created magically without having the constructor called. If its parent class is not serializable, then the super class no-args constructor is invoked. For example, let's begin with a superclass that does not implement Serializable ...

Community: General