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

EDS (Electronic Data Systems India Pvt Ltd) at Chennai on 16-12-2006.

8625


What is the final variable?

583


When super keyword is used?

597


What do you understand by copy constructor in java?

492


what state does a thread enter when it terminates its processing? : Java thread

599






What's a method in programming?

551


Is java a virus?

535


What is singleton class in ruby?

564


Is arraylist ordered in java?

578


Write code of any action class?

548


What is a lambda expression ? What's its use ?

565


what do you mean by marker interface in java?

547


What is method overloading and method overriding?

538


what is singleton in java?

601


What is reverse function?

576