Use of Externalization interface

Explain the use of Externalization interface.

Externalization is same as serialization. It extends Serializable interface. To externalize your object, you need to implement Externalizable interface that extends Serializable interface. It is mostly used when you need to add data to the serialization stream that are not the serialized object data members (from external source).Every class that uses/implements externalization must implement Externalizable interface and override methods : -writeExternal-readExternal-and must have a constructor that takes no arguments. One thing you can do with Externalization is that you can store extra information into object like STATIC variables and transient variables or you can add more information if you have any business need.
Widening conversion and Narrowing conversion
For a primitive data types, a value narrower data type can be converted to a value of a broader data type without loss of information...
How do we implement deep cloning?
Deep cloning makes a distinct copy of each of object’s field. By this the two objects are not dependent on each other...
Java features
Java features - Simple, Object-Oriented, Robust, Distributed, Portable, Interpreted, Multithreaded, Platform Independent, Secure...
Post your comment