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
What is a boolean flag in java?
What is the role of the java.rmi.naming class?
What is the function of static in java?
What does three dots mean in java?
What are the uses of synchronized keyword?
Explain about arraylist?
can I implement my own start() method? : Java thread
What exactly is a .class file?
List implementations of list interface?
Why java strings are immutable in nature?
Is array dynamic in java?
If a method is declared as protected, where may the method be accessed in java programming?
What is math floor in java?
What super () does in java?
What is singleton math?