NewArray (int size) Create an array of type T and length size, just a sentence (return new T ).
![transtype in java transtype in java](https://1.bp.blogspot.com/-NaQH-0nVIzk/YJPktBsT--I/AAAAAAAAAVA/mWqnGLLqVroFUlsqwGGJ_R0y3HI0RSFUACLcBGAsYHQ/w400-h238/transient-in-java.png)
I have not tested the specific situation!Ģ) describeContents () doesn't understand what is the use, anyway, it can return 0 directlyģ) static final Parcelable.Creator object CREATOR this CREATOR naming is fixed, and its corresponding interface has two methods:ĬreateFromParcel (Parcel source) The function of creating an instance from source Looking at the code examples on the Internet, personal guesses that the order of reading Parcel data must be consistent with the order of writing here, otherwise the wrong data may be read. Parcelable needs to implement three functions:ġ) void writeToParcel (Parcel dest, int flags) writes the data that needs to be serialized and stored in the externally provided Parcel object dest. In addition to Serializable, using Parcelable can also achieve the same effect, but unlike serializing objects, the principle of Parcelable is to decompose a complete object, and each part of the decomposition is data supported by Intent Type, so that the function of passing objects is realized. As for the serialization method, it is also very simple, only need to let a class implement the Serializable interface. The serialized objects can be transmitted on the network or stored locally.
![transtype in java transtype in java](https://windows-cdn.softpedia.com/screenshots/TTFEdit_2.png)
Serializable means serialization, which means that an object is converted into a state that can be stored or transmitted.
![transtype in java transtype in java](http://www.tsnien.idv.tw/Java2_WebBook/%E6%8F%92%E5%9C%96/chap11/%E5%9C%96%2011-1.png)
TRANSTYPE IN JAVA ANDROID
Is a serialization class provided by Android that is more efficient than Serializable. Public class EmvTransData implements Parcelable From the code point of view, this class inherits Parcelable, is a serialized class, here uses the Parcelable interface to serialize ,