The transient keyword s instance variables that shall not be included in default serialization. Because only objects can be serialized, not classes, transient only works for instance fields.transient is to indicate that the variable is not part of the persistent state of an object. Ex : class Point { 
int x,y; 
transient float secret; 
} when you store this object, only the fiels x,y would be save. 

解决方案 »

  1.   

    The transient modifier is used with variables. It indicates that a variable may not be serialized. Its typically used to reduce the possibility that an Object containing sensitive data might be witten to a stream (ex: password). A transient variable may not be declared as final or static.
      

  2.   

    在序列化该object(就是把对象保存到文件中)时,有transient声明的成员变量不会被保存到文件中。
      

  3.   

    tong yi lou shang de
      

  4.   

    Regard when you use transient variables, remember reinitialize it after deserialization. cos it may contain a indeterminate value.