Interface instantiation
A general object, such as a specific class person, has been defined and needs to be instantiated. The syntax adopted is person objperson = new person ();
But the interface (such as iconnection) cannot do this, and it cannot directly new itself, such as iconnection objiconnection = new iconnection (),
This is the meaning of "the interface object cannot be generated as usual.
However, the object orientation is polymorphism and can be transformed upwards. For example, if a class implements this interface, and a class connection implements this interface, the connection class
An object can be instantiated to the iconnection interface. For example, iconnection objiconnection = new connection ()
Then, all programming operations are performed based on interfaces, which is separated from the implementation of specific classes and is more flexible and easy to expand in some cases.
Abstract The changed things into interfaces. Instead, letCodeIt is relatively fixed and can adapt to changes.
The interface cannot be real-listed, but it may be used to create an interface for the class through some classes
What is object serialization?
Let's start with why the object is serialized. Object serialization is required because sometimes data objects need to be transmitted over the network. During transmission, the objects need to be serialized and the serialized objects need to be taken out from the server storage media, then it is transmitted to the client through the network, and then the client reads the serialized object data into the memory, performs corresponding processing, saves the object data to the local storage medium, and then presents it as a file. This process is: Object> serialization> transmission> storage> deserialization (re-file format ). In my personal understanding, serialization is quite a kind of deep cloning, that is, converting your data objects into binary data for easy storage and transmission. Only after the objects are serialized can they be stored in the storage media; deserialization enables object data to be presented as files.