Is it possible to serialize a single member in a class?

Suppose i have 2 members in my class can i serialize a single member? Is there any way to do that?

Questions by sahadeva

Showing Answers 1 - 15 of 15 Answers

vaneet

  • Jun 3rd, 2008
 

We will have to make the other member(which u dont want to serailize) as transient. Although making a member as transient is not the best way...( as what will we do if we have 25 members and we need to serialize only 1 out of them...making all the others transient is not the best practice)

Yes, it is possible to serialize a single member in a class from the externializable interface as we can control the searization process with the and by searilizing the single memer through writeExternal() and readExternal() method we can do it.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions