I have 2 objects inside one object(vector). how can i
serialize one of them. I dont want to serialize the second one
Answers were Sorted based on User's Feedback
Answer / 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 |
this answer is not correct. bcz java compiler will throw an error-illegal declaration of statement.check it out.
I think we will go for Externalizable interface. But the problem is how write the code inside writeExternal() & readExternal() methods
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / priya
yes we are able to done the above question by using
transient keyword
| Is This Answer Correct ? | 0 Yes | 2 No |
what is daemon thread and which method is used to create the daemon thread? : Java thread
What is the difference between a field variable and a local variable?
List out five keywords related to exception handling ?
How to validate the request (Eg:user name and password) in session(http session)? not in LDAP server ?
Explain the significance of class loaders in bootstrap?
What is entry set in java?
Which java ide is used the most?
I want my class to be developed in such a way that no other class (even derived class) can create its objects. How can I do so?
What is t type java?
Explain the difference between scrollbar and scrollpane?
Does string isempty check for null?
What is meant by serialisation and deserialisation?