java - Is it possible to serialize transient field of the class using my custom serialization or using Externalization? -


is possible serialize transient field of class using custom serialization or using externalization?

example: there class person having name field transient

transient string name; 

is possible serialize using below methods?

private void writeobject(objectoutputstream out) throws ioexception; private void readobject(objectinputstream in) throws ioexception, classnotfoundexception; 

the answer yes if using custom serializaton. when custom serialization overriding writeobject method, take control of serialization , can whatever want. can assign or use value of transient field , can marshall along other class attributes.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -