Java's serialization provides an elegant, and easy to use mechanism for making an object's state persistent.
While controlling object serialization, we might have a particular object data member that we do not want the serialization
mechanism to save.To turn off serialization on a certain field of an object, we tag that field of the class of our object with
the Java's "transient" keyword. This, to low-level parts of the Java virtual machine, is an indication that the transient variable
is not part of the persistent state of an object.
前段时间参加面试被问到了 HashMap 的原理,但是对 HashMap 的了解都是通过博客,一面建议我还是多看看源码,博客的知识毕竟有一些过时了,所以今天就来研究研究源码,然后发现HashMap的变量里有一个transient关键字,从来没见过,于是去百度了一下,现在做个总结好了~Java's serialization provides an elegant, and easy to us...