I have 2 objects inside one object(vector). how can i
serialize one of them. I dont want to serialize the second one

Answer Posted / atre sachin

suppose we are storing the two object of class A in Vector v1

class A implements serialiazable{
....
}

A a1=new A() //this will be the persist
transient A a2 =new A() //this will not persist because of the transient keyword.

now if I store the both a1 and a2 object in the vector v1 then we can achieve the goal given.
:-)

Is This Answer Correct ?    10 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does java isempty check for null?

565


What are the parts of a method?

531


Why bytecode is called bytecode?

581


What does i ++ mean in Java?

496


Explain the pointers in Java?

590






What is a Presistent Object?

634


What is the statements?

585


What is stringwriter?

535


What is java volatile?

538


What are the data types supported by java?

542


What are functions in java?

496


What is empty string literal in java?

555


What is anagram of a string?

512


which class is the wait() method defined in? : Java thread

519


How to obtain a performance profile of java program

540