GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  J2EE  >  Core Java
Go To First  |  Previous Question  |  Next Question 
 Core Java  |  Question 479 of 502    Print  
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?


  
Total Answers and Comments: 4 Last Update: June 08, 2008     Asked by: sahadeva 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: atmarammuduli
 
u can declare the member as transient so that it wont be serialized.

Above answer was rated as good by the following members:
interviewprep9, vasanthakumar.ss
May 30, 2008 01:59:37   #1  
atmarammuduli Member Since: December 2007   Contribution: 8    

RE: Is it possible to serialize a single member in a class?
u can declare the member as transient so that it wont be serialized.
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
June 01, 2008 15:44:24   #2  
Karuna Reddy Member Since: June 2007   Contribution: 40    

RE: Is it possible to serialize a single member in a class?
yes ur class implement serilizable
 
Is this answer useful? Yes | No
June 03, 2008 03:00:10   #3  
vaneet Member Since: July 2007   Contribution: 9    

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

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)


 
Is this answer useful? Yes | No
June 08, 2008 03:46:29   #4  
chenw2000 Member Since: January 2008   Contribution: 4    

RE: Is it possible to serialize a single member in a class?
how about move the other 24 member variable to a class?...
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape