As we know we can instantiate an object without new keyword by using classloader/object cloning/object serialization. When I am using these techniques to create an object, is the constructor called or not?
As we know we can instantiate an object without new keyword by using classloader/object
Share
For
Object.cloneno constructor is called.For serialisation, the most derived non-serialisable base-class no-arg constructor is called. Typically implemented by loading bytecode that does not validate. The constructor must be accessible to the base-most serialisable class.