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
How many bytes is a char in java?
Write a program to find maximum and minimum number in array?
What is a cup of java?
What are the fileinputstream and fileoutputstream?
What is %02d?
What are user defined exceptions?
If you are given the name of the function at run time how will you invoke the function?
What are the pillars of java?
Can I uninstall java?
What is exception handling in java?
What is tree node in java?
Can inner class be public in java?
What is float in java?
Is java map thread safe?
Where are register variables stored?