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 top level class in java?
Why packages are used?
What is comparable and comparator interface? List their differences
How does arraylist work in java?
What is jvm? Why is java called the platform independent programming language?
What is ordered map in java?
What does the string method compareto () do?
Why call by value prevents parameter value change?
Can a set contain duplicates?
What is default constructors?
What is the difference between double and float variables in java?
How do you declare a variable?
Can we overload final method in java?
make a method which any number and any type of argument and print sum of that arguments.....
What is abstract class constructor called?